Bug 843247 - Allow external links to be opened in private windows in perma-private mode. r=ehsan a=bajaj
authorJosh Matthews <josh@joshmatthews.net>
Tue, 26 Feb 2013 16:46:36 -0500
changeset 127642 ff59832f39011a791f9e37799f5ee7bad1b8c6f1
parent 127641 a3132e813f52180768800eeeffc1693165dc4998
child 127643 d640169dd0d5dac7de4dfa5db9617106b8008cb9
push id2213
push userjosh@joshmatthews.net
push dateMon, 04 Mar 2013 22:24:04 +0000
treeherdermozilla-beta@ff59832f3901 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, bajaj
bugs843247
milestone20.0
Bug 843247 - Allow external links to be opened in private windows in perma-private mode. r=ehsan a=bajaj
browser/components/nsBrowserContentHandler.js
--- 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;
   }