Bug 1274007 - Firefox Refresh shouldn't show the 'Firefox on Windows 10' start page when you refresh on Windows 10, r?MattN
MozReview-Commit-ID: 68CaJR5IsE1
--- a/browser/components/migration/FirefoxProfileMigrator.js
+++ b/browser/components/migration/FirefoxProfileMigrator.js
@@ -24,16 +24,18 @@ XPCOMUtils.defineLazyModuleGetter(this,
XPCOMUtils.defineLazyModuleGetter(this, "SessionMigration",
"resource:///modules/sessionstore/SessionMigration.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "OS",
"resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
"resource://gre/modules/FileUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ProfileAge",
"resource://gre/modules/ProfileAge.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
+ "resource://gre/modules/AppConstants.jsm");
function FirefoxProfileMigrator() {
this.wrappedJSObject = this; // for testing...
}
FirefoxProfileMigrator.prototype = Object.create(MigratorPrototype);
@@ -143,16 +145,21 @@ FirefoxProfileMigrator.prototype._getRes
let buildID = Services.appinfo.platformBuildID;
let mstone = Services.appinfo.platformVersion;
// Force the browser to one-off resume the session that we give it:
Services.prefs.setBoolPref("browser.sessionstore.resume_session_once", true);
// Reset the homepage_override prefs so that the browser doesn't override our
// session with the "what's new" page:
Services.prefs.setCharPref("browser.startup.homepage_override.mstone", mstone);
Services.prefs.setCharPref("browser.startup.homepage_override.buildID", buildID);
+ // Also set the Windows 10 pref to avoid the win10 intro page to show up
+ // on startup.
+ if (AppConstants.isPlatformAndVersionAtLeast("win", "10")) {
+ Services.prefs.setBoolPref("browser.usedOnWindows10", true);
+ }
// It's too early in startup for the pref service to have a profile directory,
// so we have to manually tell it where to save the prefs file.
let newPrefsFile = currentProfileDir.clone();
newPrefsFile.append("prefs.js");
Services.prefs.savePrefFile(newPrefsFile);
aCallback(true);
}, function() {
aCallback(false);