From 7a8e6828116b22655ce527edf50990068cb181df Mon Sep 17 00:00:00 2001 From: Infocatcher Date: Fri, 13 Dec 2013 17:52:19 +0400 Subject: [PATCH] Correctly handle private tabs in cloned windows in Firefox 29.0a1 Testcase: var ss = ( Components.classes["@mozilla.org/browser/sessionstore;1"] || Components.classes["@mozilla.org/suite/sessionstore;1"] ).getService(Components.interfaces.nsISessionStore); var state = ss.getWindowState(window); var win = window.openDialog( getBrowserURL(), "_blank", "chrome,all,dialog=no" ); win.addEventListener("load", function restoreSession(e) { win.removeEventListener(e.type, restoreSession, false); win.focus(); ss.setWindowState(win, state, true); }, false); --- bootstrap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap.js b/bootstrap.js index 3e45db6..26253e7 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -1044,8 +1044,8 @@ var windowsObserver = { this.toggleTabPrivate(tab, isPrivate); else { window.setTimeout(function() { - if(tab.parentNode) // Handle only not yet closed tabs - this.setTabState(tab); + if(tab.parentNode) // Handle only not yet closed tabs + check attribute from nsISessionStore + this.setTabState(tab, tab.hasAttribute(this.privateAttr) || undefined); }.bind(this), 0); }