usePrivateBrowsing; }, isBrowserPrivate(aBrowser) { let chromeWin = aBrowser.ownerGlobal; if (chromeWin.gMultiProcessBrowser || !aBrowser.contentWindow) { // In e10s we have to look at the chrome window's private // browsing status since the only alternative is to check the // content window, which is in another process. If the browser // is lazy or is running in windowless configuration then the // content window doesn't exist. return this.isWindowPrivate(chromeWin); } return this.privacyContextFromWindow(aBrowser.contentWindow) .usePrivateBrowsing; }, privacyContextFromWindow: function pbu_privacyContextFromWindow(aWindow) { return aWindow.docShell.QueryInterface(Ci.nsILoadContext); }, get permanentPrivateBrowsing() { try { return ( gTemporaryAutoStartMode || Services.prefs.getBoolPref(kAutoStartPref) ); } catch (e) { // The pref does not exist return false; } }, // These should only be used from internal code enterTemporaryAutoStartMode: function pbu_enterTemporaryAutoStartMode() { gTemporaryAutoStartMode = true; }, get isInTemporaryAutoStartMode() { return gTemporaryAutoStartMode; }, }; PK