Bug 1423811 - Do not attempt to reset search settings of users with an original default engine that isn't considered a default engine (likely due to a langpack). r=adw, a=jcristau DEVEDITION_58_0b11_RELEASE FENNEC_58_0b11_BUILD1 FENNEC_58_0b11_RELEASE FIREFOX_58_0b11_BUILD1 FIREFOX_58_0b11_RELEASE
authorFlorian Quèze <florian@queze.net>
Sun, 10 Dec 2017 01:39:16 +0100
changeset 445304 d7ddb4b0dc03cb110b8936c89465ca5e08ea71be
parent 445303 b61b2f87160b375d54b121920b4befd9668963e5
child 445305 e130cae4ad81cac3cab4a9aeffa63ccbcb2f8fa9
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw, jcristau
bugs1423811
milestone58.0
Bug 1423811 - Do not attempt to reset search settings of users with an original default engine that isn't considered a default engine (likely due to a langpack). r=adw, a=jcristau
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2228,17 +2228,21 @@ BrowserGlue.prototype = {
           Services.obs.removeObserver(observer, SEARCH_SERVICE_TOPIC);
           resolve();
         }, SEARCH_SERVICE_TOPIC);
       });
       searchInitializedPromise.then(() => {
         let currentEngine = Services.search.currentEngine.wrappedJSObject;
         // Only reset the current engine if it wasn't set by a WebExtension
         // and it is not one of the default engines.
-        if (currentEngine._extensionID || currentEngine._isDefault)
+        // If the original default is not a default, the user has a weird
+        // configuration probably involving langpacks, it's not worth
+        // attempting to reset their settings.
+        if (currentEngine._extensionID || currentEngine._isDefault ||
+            !Services.search.originalDefaultEngine.wrappedJSObject._isDefault)
           return;
 
         if (currentEngine._loadPath.startsWith("[https]")) {
           Services.prefs.setCharPref("browser.search.reset.status", "pending");
         } else {
           // Can't call resetToOriginalDefaultEngine because it doesn't
           // unhide the engine.
           let defaultEngine = Services.search.originalDefaultEngine;