Bug 1077643 - Enable WhatsNew page in-product for 33.X anniversary
authorMark Hammond <mhammond@skippinet.com.au>
Thu, 16 Oct 2014 17:20:04 +1100
changeset 218140 1d7405a097b1
parent 218139 860d5a053b5f
child 218141 e0d4cbcae717
push id553
push userryanvm@gmail.com
push date2014-10-29 12:21 +0000
treeherdermozilla-release@766b4b4fa7c7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1077643
milestone33.0.2
Bug 1077643 - Enable WhatsNew page in-product for 33.X anniversary From 1a13bb19194c4b5ca8d01ab153e3b22b7ee9947a Mon Sep 17 00:00:00 2001 release. r=gavin --- browser/components/nsBrowserContentHandler.js | 29 ++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-)
browser/components/nsBrowserContentHandler.js
--- a/browser/components/nsBrowserContentHandler.js
+++ b/browser/components/nsBrowserContentHandler.js
@@ -584,17 +584,44 @@ nsBrowserContentHandler.prototype = {
             // that this is an "update" session. This does not take crashes
             // into account because that requires waiting for the session file
             // to be read. If a crash occurs after updating, before restarting,
             // we may open the startPage in addition to restoring the session.
             var ss = Components.classes["@mozilla.org/browser/sessionstartup;1"]
                                .getService(Components.interfaces.nsISessionStartup);
             willRestoreSession = ss.isAutomaticRestoreEnabled();
 
-            overridePage = Services.urlFormatter.formatURLPref("startup.homepage_override_url");
+            // Temporary case for 33.X anniversary release's "panic button" (bug 1077643)
+            let locale = "en-US";
+            try {
+              locale = Services.prefs.getCharPref("general.useragent.locale");
+            } catch (e) {}
+
+            // We only want to show if our locale is in the pref privacy.panicButton.enabledLocales
+            // and the privacy.panicButton.enabled pref is set.
+            let featureEnabled;
+            let enabledLocales = [];
+            try {
+              featureEnabled = Services.prefs.getBoolPref("privacy.panicButton.enabled");
+              enabledLocales = Services.prefs.getCharPref("privacy.panicButton.enabledLocales").split(" ");
+            } catch (ex) {}
+            if (featureEnabled && enabledLocales.indexOf(locale) != -1) {
+              // Note we don't pass %OLD_VERSION to formatURL - while it will
+              // not replace it with anything, it will complain about the
+              // unknown value.
+              overridePage = Services.urlFormatter.formatURL(
+                "https://www.mozilla.org/%LOCALE%/firefox/%VERSION%/whatsnew/"
+              ) + "?oldversion=%OLD_VERSION%";
+            }
+            // End of temporary 33.x anniversary code.
+
+// The override page being specified in startup.homepage_override_url is
+// temporarily disabled while the 33.x code above is in place.
+// (But we still let the updater specify a page, just in case...)
+//            overridePage = Services.urlFormatter.formatURLPref("startup.homepage_override_url");
             if (prefb.prefHasUserValue("app.update.postupdate"))
               overridePage = getPostUpdateOverridePage(overridePage);
 
             overridePage = overridePage.replace("%OLD_VERSION%", old_mstone);
             break;
         }
       }
     } catch (ex) {}