Bug 843247 - Allow external links to be opened in private windows in perma-private mode. r=ehsan a=bajaj
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -725,18 +725,19 @@ nsBrowserContentHandler.prototype = {
};
var gBrowserContentHandler = new nsBrowserContentHandler();
function handURIToExistingBrowser(uri, location, cmdLine)
{
if (!shouldLoadURI(uri))
return;
- // Do not open external links in private windows
- var navWin = RecentWindow.getMostRecentBrowserWindow({private: false});
+ // Do not open external links in private windows, unless we're in perma-private mode
+ var allowPrivate = PrivateBrowsingUtils.permanentPrivateBrowsing;
+ var navWin = RecentWindow.getMostRecentBrowserWindow({private: allowPrivate});
if (!navWin) {
// if we couldn't load it in an existing window, open a new one
openWindow(null, gBrowserContentHandler.chromeURL, "_blank",
"chrome,dialog=no,all" + gBrowserContentHandler.getFeatures(cmdLine),
uri.spec);
return;
}