From 9bb07216b607f26b2be64dad6aac0807831c02f0 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Fri, 17 Jul 2015 18:02:05 -0400 Subject: [PATCH] Bug 1185012 - Display a message to a Firefox user the first time they open Firefox in Windows 10. r=MattN --- browser/components/nsBrowserContentHandler.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/browser/components/nsBrowserContentHandler.js b/browser/components/nsBrowserContentHandler.js index e0143e9541a5..1a8aa6c6249a 100644 --- a/browser/components/nsBrowserContentHandler.js +++ b/browser/components/nsBrowserContentHandler.js @@ -548,6 +548,24 @@ nsBrowserContentHandler.prototype = { if (overridePage == "about:blank") overridePage = ""; + // Temporary override page for users who are running Firefox on Windows 10 for their first time. + let platformVersion = Services.sysinfo.getProperty("version"); + if (AppConstants.platform == "win" && + Services.vc.compare(platformVersion, "10") == 0 && + Services.prefs.getPrefType("browser.usedOnWindows10") == Services.prefs.PREF_BOOL && + !Services.prefs.getBoolPref("browser.usedOnWindows10")) { + Services.prefs.setBoolPref("browser.usedOnWindows10", true); + let firstUseOnWindows10URL = Services.urlFormatter.formatURL("https://www.mozilla.org/%LOCALE%/firefox/windows10/"); + + if (firstUseOnWindows10URL && firstUseOnWindows10URL.length) { + if (overridePage) { + overridePage += "|" + firstUseOnWindows10URL; + } else { + overridePage = firstUseOnWindows10URL; + } + } + } + var startPage = ""; try { var choice = prefb.getIntPref("browser.startup.page");