Bug 1579735 - Let PB windows be identified by backend and themes. r=frg a=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Tue, 01 Oct 2019 16:59:24 +0200
changeset 32321 242953296b0fdb50612627dc56846ab6e060da9b
parent 32320 8643534c597195f0b45b4d94d4ceb695e804eece
child 32322 e71c6693877fc37d1d3da784cac30a8c6d398406
push id220
push userfrgrahl@gmx.net
push dateTue, 01 Oct 2019 15:01:16 +0000
treeherdercomm-esr60@e71c6693877f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg, frg
bugs1579735
Bug 1579735 - Let PB windows be identified by backend and themes. r=frg a=frg
suite/base/content/tasksOverlay.js
suite/browser/navigator.js
--- a/suite/base/content/tasksOverlay.js
+++ b/suite/base/content/tasksOverlay.js
@@ -139,25 +139,25 @@ function OpenBrowserWindow()
   if (document.documentElement.getAttribute("windowtype") ==
       "navigator:browser" && window.content && window.content.document)
   {
     // if and only if the current window is a browser window and
     // it has a document with a character set, then extract the
     // current charset menu setting from the current document
     // and use it to initialize the new browser window
     return window.openDialog(getBrowserURL(), "_blank",
-                             "chrome,all,dialog=no", null,
+                             "chrome,all,dialog=no,non-private", null,
                              "charset=" + window.content.document.characterSet);
   }
 
   if (win) {
     // if a browser window already exists then set startpage to null so
     // navigator.js can check pref for how new window should be opened
     return win.openDialog(getBrowserURL(), "_blank",
-                          "chrome,all,dialog=no", null);
+                          "chrome,all,dialog=no,non-private", null);
   }
 
   // open the first browser window as if we were starting up
   var cmdLine = {
     handleFlagWithParam: function handleFlagWithParam(flag, caseSensitive) {
       return flag == "remote" ? "xfeDoCommand(openBrowser)" : null;
     },
     handleFlag: function handleFlag(flag, caseSensitive) {
--- a/suite/browser/navigator.js
+++ b/suite/browser/navigator.js
@@ -816,23 +816,25 @@ function Startup()
   // set home button tooltip text
   updateHomeButtonTooltip();
 
   var lc = window.QueryInterface(Ci.nsIInterfaceRequestor)
                  .getInterface(Ci.nsIWebNavigation)
                  .QueryInterface(Ci.nsILoadContext);
   if (lc.usePrivateBrowsing) {
     gPrivate = window;
-    document.documentElement.removeAttribute("windowtype");
-    var titlemodifier = document.documentElement.getAttribute("titlemodifier");
+    let docElement = document.documentElement;
+    var titlemodifier = docElement.getAttribute("titlemodifier");
     if (titlemodifier)
       titlemodifier += " ";
-    titlemodifier += document.documentElement.getAttribute("titleprivate");
-    document.documentElement.setAttribute("titlemodifier", titlemodifier);
+    titlemodifier += docElement.getAttribute("titleprivate");
+    docElement.setAttribute("titlemodifier", titlemodifier);
     document.title = titlemodifier;
+    docElement.setAttribute("privatebrowsingmode",
+      PrivateBrowsingUtils.permanentPrivateBrowsing ? "permanent" : "temporary");
   }
 
   // initialize observers and listeners
   var xw = lc.QueryInterface(Ci.nsIDocShellTreeItem)
              .treeOwner
              .QueryInterface(Ci.nsIInterfaceRequestor)
              .getInterface(Ci.nsIXULWindow);
   xw.XULBrowserWindow = window.XULBrowserWindow = new nsBrowserStatusHandler();