Bug 1414965 - Reset geo preferences for Firefox 57. r?florian draft
authorMichael Kaply <mozilla@kaply.com>
Mon, 06 Nov 2017 16:01:34 -0600
changeset 693837 0beca6ce393b46fa40a9c873fe58b1f8f0ae4834
parent 690074 b6deaf2bb469f90e88f979c75e125acec8fd943c
child 739156 0cfea6cf24b4264f3cab030e40ebfa33fd035778
push id87937
push usermozilla@kaply.com
push dateMon, 06 Nov 2017 23:31:53 +0000
reviewersflorian
bugs1414965
milestone58.0a1
Bug 1414965 - Reset geo preferences for Firefox 57. r?florian MozReview-Commit-ID: FukSW7TB4Av
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1736,17 +1736,17 @@ BrowserGlue.prototype = {
         return;
       this._openPreferences("sync", { origin: "doorhanger" });
     };
     this.AlertsService.showAlertNotification(null, title, body, true, null, clickCallback);
   },
 
   // eslint-disable-next-line complexity
   _migrateUI: function BG__migrateUI() {
-    const UI_VERSION = 57;
+    const UI_VERSION = 58;
     const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
 
     let currentUIVersion;
     if (Services.prefs.prefHasUserValue("browser.migration.version")) {
       currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
     } else {
       // This is a new profile, nothing to migrate.
       Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
@@ -2161,16 +2161,23 @@ BrowserGlue.prototype = {
           if (renaissanceTheme) {
             renaissanceTheme.accentcolor = "#834d29";
             lwthemePrefs.setStringPref("usedThemes", JSON.stringify(usedThemes));
           }
         } catch (e) { /* Don't panic if this pref isn't what we expect it to be. */ }
       }
     }
 
+    if (currentUIVersion < 58) {
+      // With Firefox 57, we are doing a one time reset of the geo prefs due to bug 1413652
+      Services.prefs.clearUserPref("browser.search.countryCode");
+      Services.prefs.clearUserPref("browser.search.region");
+      Services.prefs.clearUserPref("browser.search.isUS");
+    }
+
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
   },
 
   _checkForDefaultBrowser() {
     // Perform default browser checking.
     if (!ShellService) {
       return;