Bug 1274007 - Firefox Refresh shouldn't show the 'Firefox on Windows 10' start page when you refresh on Windows 10, r?MattN draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 19 May 2016 11:01:03 +0100
changeset 368686 9fa3472b863af2cc58fab3ae72a18a31e26f4f6c
parent 368685 5a4cdb6dfb19b458229c60e0e19f083ba83d0f58
child 521356 496377079069b5d33ed5367a90c1a0130b15801d
push id18624
push usergijskruitbosch@gmail.com
push dateThu, 19 May 2016 10:01:23 +0000
reviewersMattN
bugs1274007
milestone49.0a1
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);