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 132275 5071df23241386e7d4196fd78aaa24ff30f69153
parent 132274 ecd6788ad15a6627d847e905349c98fb2557ffe2
child 132276 a4ed90fa7682109c5cdf017132aeb001bd84b744
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan, bajaj
bugs843247
milestone21.0a2
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
@@ -716,18 +716,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;
   }