Bug 1438069 - "Get me out of here" button now redirects to page "Private Browsing with Tracking Protection" in private mode - r=johannh
authorArthur Deschamps <arthur.deschamps1208@hotmail.com>
Tue, 20 Feb 2018 19:27:55 +0100
changeset 407097 a6faba65ff298d7c628effeb00cefc3b06579322
parent 407096 eb093a16f93976ca5f04824f870cdd7503987e48
child 407098 01d346536b693462daa156c4e4c0e092b3929774
push id33589
push usercsabou@mozilla.com
push dateThu, 08 Mar 2018 03:59:55 +0000
treeherdermozilla-central@888f3dded126 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjohannh
bugs1438069
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1438069 - "Get me out of here" button now redirects to page "Private Browsing with Tracking Protection" in private mode - r=johannh
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3253,16 +3253,18 @@ function goBackFromErrorPage() {
 /**
  * Return the default start page for the cases when the user's own homepage is
  * infected, so we can get them somewhere safe.
  */
 function getDefaultHomePage() {
   // Get the start page from the *default* pref branch, not the user's
   var prefs = Services.prefs.getDefaultBranch(null);
   var url = BROWSER_NEW_TAB_URL;
+  if (PrivateBrowsingUtils.isWindowPrivate(window))
+    return url;
   try {
     url = prefs.getComplexValue("browser.startup.homepage",
                                 Ci.nsIPrefLocalizedString).data;
     // If url is a pipe-delimited set of pages, just take the first one.
     if (url.includes("|"))
       url = url.split("|")[0];
   } catch (e) {
     Cu.reportError("Couldn't get homepage pref: " + e);