Bug 847959 - Make RecentWindow return any browser window regardless of requested privacy state when perma-PB mode is enabled. r=ehsan
--- 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)) {