mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Date: Mon Dec 10 00:16:09 2012 -0500
Bug 819202 - Simplify the semantics of OpenBrowserWindow: new windows are public unless explicitly passed a 'private' option or global private browsing is in effect. r=dao
This commit is contained in:
parent
ac6c245f04
commit
42f22fa563
@ -3494,17 +3494,16 @@ function OpenBrowserWindow(options)
|
||||
var wintype = document.documentElement.getAttribute('windowtype');
|
||||
|
||||
var extraFeatures = "";
|
||||
var forcePrivate = false;
|
||||
#ifdef MOZ_PER_WINDOW_PRIVATE_BROWSING
|
||||
forcePrivate = typeof options == "object" && "private" in options && options.private;
|
||||
if (typeof options == "object" && options.private) {
|
||||
#else
|
||||
forcePrivate = gPrivateBrowsingUI.privateBrowsingEnabled;
|
||||
if (gPrivateBrowsingUI.privateBrowsingEnabled) {
|
||||
#endif
|
||||
|
||||
if (forcePrivate) {
|
||||
extraFeatures = ",private";
|
||||
// Force the new window to load about:privatebrowsing instead of the default home page
|
||||
defaultArgs = "about:privatebrowsing";
|
||||
} else {
|
||||
extraFeatures = ",non-private";
|
||||
}
|
||||
|
||||
// if and only if the current window is a browser window and it has a document with a character
|
||||
|
@ -1,11 +1,24 @@
|
||||
// Make sure that we can open private browsing windows
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
var nonPrivateWin = OpenBrowserWindow();
|
||||
ok(!PrivateBrowsingUtils.isWindowPrivate(nonPrivateWin), "OpenBrowserWindow() should open a normal window");
|
||||
nonPrivateWin.close();
|
||||
|
||||
var privateWin = OpenBrowserWindow({private: true});
|
||||
ok(PrivateBrowsingUtils.isWindowPrivate(privateWin), "OpenBrowserWindow({private: true}) should open a private window");
|
||||
privateWin.close();
|
||||
|
||||
nonPrivateWin = OpenBrowserWindow({private: false});
|
||||
ok(!PrivateBrowsingUtils.isWindowPrivate(nonPrivateWin), "OpenBrowserWindow({private: false}) should open a normal window");
|
||||
nonPrivateWin.close();
|
||||
|
||||
whenDelayedStartupFinished(privateWin, function() {
|
||||
nonPrivateWin = privateWin.OpenBrowserWindow({private: false});
|
||||
ok(!PrivateBrowsingUtils.isWindowPrivate(nonPrivateWin), "privateWin.OpenBrowserWindow({private: false}) should open a normal window");
|
||||
nonPrivateWin.close();
|
||||
privateWin.close();
|
||||
finish();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ function test() {
|
||||
Services.obs.removeObserver(observer1, "domwindowopened");
|
||||
}, false);
|
||||
}, "domwindowopened", false);
|
||||
OpenBrowserWindow();
|
||||
OpenBrowserWindow({private: PrivateBrowsingUtils.isWindowPrivate(window)});
|
||||
}
|
||||
|
||||
// test the gPrivateBrowsingUI object
|
||||
|
@ -13,7 +13,7 @@ function test() {
|
||||
|
||||
pb.privateBrowsingEnabled = true;
|
||||
|
||||
let win = OpenBrowserWindow();
|
||||
let win = OpenBrowserWindow({private: PrivateBrowsingUtils.isWindowPrivate(window)});
|
||||
win.addEventListener("load", function() {
|
||||
win.removeEventListener("load", arguments.callee, false);
|
||||
executeSoon(function() {
|
||||
|
Loading…
Reference in New Issue
Block a user