Bug 1274007 - Firefox Refresh shouldn't show the 'Firefox on Windows 10' start page when you refresh on Windows 10, r=MattN
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 19 May 2016 11:01:03 +0100
changeset 298188 c2e9a445fede36181e90e39007c8bbf62e90ba7c
parent 298187 2b227a22287677ac7af098166a632e768e70d022
child 298189 9b44a0d216be66c4ac1a05d344a838a5056692e9
push id30273
push userkwierso@gmail.com
push dateFri, 20 May 2016 21:08:12 +0000
treeherdermozilla-central@c403ac05b8f4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMattN
bugs1274007
milestone49.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 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
browser/components/migration/FirefoxProfileMigrator.js
--- 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);