Bug 1552185 - Fix the @amazon search alias on non-en-US builds. r=mikedeboer
authorMark Banner <standard8@mozilla.com>
Thu, 16 May 2019 17:16:32 +0000
changeset 474210 ca120c3031d2db4c2d9bff03a1334ee25e8c8502
parent 474209 cb6320b272f90d23a044a22d6ee738f7e6bf9d24
child 474211 ef90ec1b75ea67bea9db8cca282c9852d73794db
push id113144
push usershindli@mozilla.com
push dateFri, 17 May 2019 16:44:55 +0000
treeherdermozilla-inbound@f4c4b796f845 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1552185
milestone68.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 1552185 - Fix the @amazon search alias on non-en-US builds. r=mikedeboer Differential Revision: https://phabricator.services.mozilla.com/D31489
toolkit/components/search/SearchEngine.jsm
--- a/toolkit/components/search/SearchEngine.jsm
+++ b/toolkit/components/search/SearchEngine.jsm
@@ -369,36 +369,32 @@ function ParamSubstitution(paramValue, s
     // Don't replace unknown non-optional parameters.
     return match;
   });
 }
 
 const ENGINE_ALIASES = new Map([
   ["google", ["@google"]],
   ["amazondotcom", ["@amazon"]],
-  ["amazondotcom-de", ["@amazon"]],
-  ["amazon-en-GB", ["@amazon"]],
-  ["amazon-france", ["@amazon"]],
-  ["amazon-jp", ["@amazon"]],
-  ["amazon-it", ["@amazon"]],
+  ["amazon", ["@amazon"]],
   ["twitter", ["@twitter"]],
   ["wikipedia", ["@wikipedia"]],
   ["ebay", ["@ebay"]],
   ["bing", ["@bing"]],
   ["ddg", ["@duckduckgo", "@ddg"]],
   ["yandex", ["@\u044F\u043D\u0434\u0435\u043A\u0441", "@yandex"]],
   ["baidu", ["@\u767E\u5EA6", "@baidu"]],
 ]);
 
 function getInternalAliases(engine) {
   if (!engine._isDefault) {
     return [];
   }
   for (let [name, aliases] of ENGINE_ALIASES) {
-    if (engine._shortName.startsWith(name)) {
+    if (engine._shortName == name) {
       return aliases;
     }
   }
   return [];
 }
 
 /**
  * Creates an engineURL object, which holds the query URL and all parameters.