Bug 840739 - Make opening a new URI respect the privacy status of the opener. r=ehsan

This commit is contained in:
Josh Matthews 2013-02-22 16:43:01 -05:00
parent c27ef44141
commit 357d18001b

View File

@ -7,6 +7,7 @@ let Ci = Components.interfaces;
let Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource:///modules/RecentWindow.jsm");
const nsIWebNavigation = Ci.nsIWebNavigation;
@ -4864,9 +4865,8 @@ nsBrowserAccess.prototype = {
if (window.toolbar.visible)
win = window;
else {
win = Cc["@mozilla.org/browser/browserglue;1"]
.getService(Ci.nsIBrowserGlue)
.getMostRecentBrowserWindow();
let isPrivate = PrivateBrowsingUtils.isWindowPrivate(aOpener || window);
win = RecentWindow.getMostRecentBrowserWindow({private: isPrivate});
needToFocusWin = true;
}