Bug 847959 - Make RecentWindow return any browser window regardless of requested privacy state when perma-PB mode is enabled. r=ehsan
authorJosh Matthews <josh@joshmatthews.net>
Thu, 07 Mar 2013 10:30:47 -0500
changeset 124837 a60d1c61af47064cdba33d22a26f298716eda516
parent 124836 1e4be735f546be73808e9062a4f0ea10eb753ddd
child 124838 f766a0b4686875b0137c4cec1d126eb16eb4634f
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersehsan
bugs847959
milestone22.0a1
Bug 847959 - Make RecentWindow return any browser window regardless of requested privacy state when perma-PB mode is enabled. r=ehsan
browser/modules/RecentWindow.jsm
--- a/browser/modules/RecentWindow.jsm
+++ b/browser/modules/RecentWindow.jsm
@@ -28,16 +28,17 @@ this.RecentWindow = {
   getMostRecentBrowserWindow: function RW_getMostRecentBrowserWindow(aOptions) {
     let checkPrivacy = typeof aOptions == "object" &&
                        "private" in aOptions;
 
     function isSuitableBrowserWindow(win) {
       return (!win.closed &&
               win.toolbar.visible &&
               (!checkPrivacy ||
+               PrivateBrowsingUtils.permanentPrivateBrowsing ||
                PrivateBrowsingUtils.isWindowPrivate(win) == aOptions.private));
     }
 
 #ifdef BROKEN_WM_Z_ORDER
     let win = Services.wm.getMostRecentWindow("navigator:browser");
 
     // if we're lucky, this isn't a popup, and we can just return this
     if (win && !isSuitableBrowserWindow(win)) {