Bug 1106150: fix condition="defaultEngine" MozParam. r=markh
authorGavin Sharp <gavin@gavinsharp.com>
Tue, 30 Dec 2014 08:54:23 +1100
changeset 247368 beba124659ca3f16a735e4f8b2ea02896e60c3ce
parent 247367 927ca48b5f2978fbf0b6a337663a2c9a02a293af
child 247369 67872ce1791816b5b0a273ea4b74aba6ce4b84a1
child 247404 187fab61f428db83bf9f452bc976516e4ee41d6e
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1106150
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1106150: fix condition="defaultEngine" MozParam. r=markh
toolkit/components/search/nsSearchService.js
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -1902,18 +1902,22 @@ Engine.prototype = {
 
     this._urls.push(url);
   },
 
   _isDefaultEngine: function SRCH_ENG__isDefaultEngine() {
     let defaultPrefB = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF);
     let nsIPLS = Ci.nsIPrefLocalizedString;
     let defaultEngine;
+    let pref = "defaultenginename";
+    if (getIsUS()) {
+      pref += ".US";
+    }
     try {
-      defaultEngine = defaultPrefB.getComplexValue("defaultenginename", nsIPLS).data;
+      defaultEngine = defaultPrefB.getComplexValue(pref, nsIPLS).data;
     } catch (ex) {}
     return this.name == defaultEngine;
   },
 
   /**
    * Get the icon from an OpenSearch Image element.
    * @see http://opensearch.a9.com/spec/1.1/description/#image
    */