Bug 1414965 - Reset geo preferences for Firefox 57. r=florian, a=ritu
authorMichael Kaply <mozilla@kaply.com>
Mon, 06 Nov 2017 16:01:34 -0600
changeset 435350 e03bd534039e88797345370e3f975da2fc6b78b2
parent 435349 9075468cdeb48f4bb3736728f2d2e9a17970ea6b
child 435351 ea14b85abeac942084437602be8486b410e4bfbd
push id1578
push userryanvm@gmail.com
push dateWed, 08 Nov 2017 14:08:47 +0000
treeherdermozilla-release@ea14b85abeac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, ritu
bugs1414965
milestone57.0
Bug 1414965 - Reset geo preferences for Firefox 57. r=florian, a=ritu MozReview-Commit-ID: FukSW7TB4Av
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1716,17 +1716,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);
@@ -2141,16 +2141,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;