зеркало из https://github.com/mozilla/pjs.git
Bug 502307 - Closing multiple tabs in the last browser window with Private Browsing enabled yields no warning regardless of preference setting; r=enndeakin
This commit is contained in:
Родитель
11c1f0c73f
Коммит
525c20751f
|
@ -13,10 +13,19 @@ function closeWindow(aClose, aPromptFunction)
|
|||
break;
|
||||
}
|
||||
|
||||
var inPrivateBrowsing = false;
|
||||
try {
|
||||
var pbSvc = Components.classes["@mozilla.org/privatebrowsing;1"]
|
||||
.getService(Components.interfaces.nsIPrivateBrowsingService);
|
||||
inPrivateBrowsing = pbSvc.privateBrowsingEnabled;
|
||||
} catch(e) {
|
||||
// safe to ignore
|
||||
}
|
||||
|
||||
// If we're down to the last window and someone tries to shut down, check to make sure we can!
|
||||
if (windowCount == 1 && !canQuitApplication())
|
||||
return false;
|
||||
else if (windowCount != 1)
|
||||
else if (windowCount != 1 || inPrivateBrowsing)
|
||||
#endif
|
||||
if (typeof(aPromptFunction) == "function" && !aPromptFunction())
|
||||
return false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче