Bug 1322720 - don't show the homepage on firstrun if a pref is flipped, r=dao
MozReview-Commit-ID: FhWyo7omun3
--- 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;