Bug 1322720 - don't show the homepage on firstrun if a pref is flipped, r=dao a=lizzard
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 15 Dec 2016 15:40:50 +0000
changeset 353361 16e1a0ce86e4e4b8066793ae9a89ba2ab19ecd69
parent 353360 d2f676e88f05d5bb96d31a1fc5776be8e41c1c12
child 353362 af31714b030937127b158c1c000cf975a0d4384d
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, lizzard
bugs1322720
milestone52.0a2
Bug 1322720 - don't show the homepage on firstrun if a pref is flipped, r=dao a=lizzard MozReview-Commit-ID: FhWyo7omun3
browser/app/profile/firefox.js
browser/components/nsBrowserContentHandler.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -211,16 +211,18 @@ pref("browser.shell.shortcutFavicons",tr
 pref("browser.shell.mostRecentDateSetAsDefault", "");
 pref("browser.shell.skipDefaultBrowserCheck", true);
 pref("browser.shell.defaultBrowserCheckCount", 0);
 
 // 0 = blank, 1 = home (browser.startup.homepage), 2 = last visited page, 3 = resume previous browser session
 // The behavior of option 3 is detailed at: http://wiki.mozilla.org/Session_Restore
 pref("browser.startup.page",                1);
 pref("browser.startup.homepage",            "chrome://branding/locale/browserconfig.properties");
+// Whether we should skip the homepage when opening the first-run page
+pref("browser.startup.firstrunSkipsHomepage", false);
 
 pref("browser.slowStartup.notificationDisabled", false);
 pref("browser.slowStartup.timeThreshold", 40000);
 pref("browser.slowStartup.maxSamples", 5);
 
 // This url, if changed, MUST continue to point to an https url. Pulling arbitrary content to inject into
 // this page over http opens us up to a man-in-the-middle attack that we'd rather not face. If you are a downstream
 // repackager of this code using an alternate snippet url, please keep your users safe
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -546,18 +546,21 @@ nsBrowserContentHandler.prototype = {
         startPage = this.startPage;
     } catch (e) {
       Components.utils.reportError(e);
     }
 
     if (startPage == "about:blank")
       startPage = "";
 
-    // Only show the startPage if we're not restoring an update session.
-    if (overridePage && startPage && !willRestoreSession)
+    let skipStartPage = override == OVERRIDE_NEW_PROFILE &&
+      prefb.getBoolPref("browser.startup.firstrunSkipsHomepage");
+    // Only show the startPage if we're not restoring an update session and are
+    // not set to skip the start page on this profile
+    if (overridePage && startPage && !willRestoreSession && !skipStartPage)
       return overridePage + "|" + startPage;
 
     return overridePage || startPage || "about:blank";
   },
 
   get startPage() {
     var uri = Services.prefs.getComplexValue("browser.startup.homepage",
                                              nsIPrefLocalizedString).data;