Bug 1314237 - detect nightly/devedition as 'firefox' in migration code, r=mikedeboer draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 01 Nov 2016 11:57:30 +0000
changeset 432327 e5bc06bc2874cd378a2a8efb1f491a31e446e043
parent 431996 2c773b97167252cedcba0be0c7af9d4cab192ef5
child 535603 a48ea6ee1c32d6bf90034a99707e2acb32ef0cfc
push id34261
push usergijskruitbosch@gmail.com
push dateTue, 01 Nov 2016 17:09:33 +0000
reviewersmikedeboer
bugs1314237
milestone52.0a1
Bug 1314237 - detect nightly/devedition as 'firefox' in migration code, r=mikedeboer MozReview-Commit-ID: 6vQa59i81Gb
browser/components/migration/MigrationUtils.jsm
--- a/browser/components/migration/MigrationUtils.jsm
+++ b/browser/components/migration/MigrationUtils.jsm
@@ -669,30 +669,35 @@ this.MigrationUtils = Object.freeze({
    */
   getMigratorKeyForDefaultBrowser() {
     // Canary uses the same description as Chrome so we can't distinguish them.
     const APP_DESC_TO_KEY = {
       "Internet Explorer":                 "ie",
       "Microsoft Edge":                    "edge",
       "Safari":                            "safari",
       "Firefox":                           "firefox",
+      "Nightly":                           "firefox",
       "Google Chrome":                     "chrome",  // Windows, Linux
       "Chrome":                            "chrome",  // OS X
       "Chromium":                          "chromium", // Windows, OS X
       "Chromium Web Browser":              "chromium", // Linux
       "360\u5b89\u5168\u6d4f\u89c8\u5668": "360se",
     };
 
     let key = "";
     try {
       let browserDesc =
         Cc["@mozilla.org/uriloader/external-protocol-service;1"]
           .getService(Ci.nsIExternalProtocolService)
           .getApplicationDescription("http");
       key = APP_DESC_TO_KEY[browserDesc] || "";
+      // Handle devedition, as well as "FirefoxNightly" on OS X.
+      if (!key && browserDesc.startsWith("Firefox")) {
+        key = "firefox";
+      }
     }
     catch (ex) {
       Cu.reportError("Could not detect default browser: " + ex);
     }
 
     // "firefox" is the least useful entry here, and might just be because we've set
     // ourselves as the default (on Windows 7 and below). In that case, check if we
     // have a registry key that tells us where to go: