mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 722994 - globalOverlay.js uses global Private Browsing state to control display of a prompt; r=ehsan
This commit is contained in:
parent
9e198d3f62
commit
1651f71fd2
@ -492,13 +492,6 @@ BrowserGlue.prototype = {
|
||||
if (!aQuitType)
|
||||
aQuitType = "quit";
|
||||
|
||||
// Never show a prompt inside private browsing mode
|
||||
var inPrivateBrowsing = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService).
|
||||
privateBrowsingEnabled;
|
||||
if (inPrivateBrowsing)
|
||||
return;
|
||||
|
||||
var showPrompt = false;
|
||||
var mostRecentBrowserWindow;
|
||||
|
||||
@ -530,6 +523,12 @@ BrowserGlue.prototype = {
|
||||
return;
|
||||
}
|
||||
|
||||
var inPrivateBrowsing = Cc["@mozilla.org/privatebrowsing;1"].
|
||||
getService(Ci.nsIPrivateBrowsingService).
|
||||
privateBrowsingEnabled;
|
||||
if (inPrivateBrowsing)
|
||||
return;
|
||||
|
||||
if (!showPrompt)
|
||||
return;
|
||||
|
||||
|
@ -17,21 +17,10 @@ function closeWindow(aClose, aPromptFunction)
|
||||
break;
|
||||
}
|
||||
|
||||
var inPrivateBrowsing = false;
|
||||
try {
|
||||
if (["@mozilla.org/privatebrowsing;1"] in Components.classes) {
|
||||
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("lastwindow"))
|
||||
return false;
|
||||
else if (windowCount != 1 || inPrivateBrowsing)
|
||||
else if (windowCount != 1)
|
||||
#endif
|
||||
if (typeof(aPromptFunction) == "function" && !aPromptFunction())
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user