Bug 1593040 - Update the search schema to match the current implementation. r=mikedeboer
authorMark Banner <standard8@mozilla.com>
Mon, 04 Nov 2019 12:33:00 +0000
changeset 500353 c1726de00b8dc75aaa4488e264e9e5c97dd5f742
parent 500352 0dbda33a1347da9b33861a257c81f185581ece89
child 500354 fbdabe5564160102fe53dd1a475c2eadf5f5c095
push id36763
push userrmaries@mozilla.com
push dateMon, 04 Nov 2019 21:44:06 +0000
treeherdermozilla-central@75a7a3400888 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1593040
milestone72.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 1593040 - Update the search schema to match the current implementation. r=mikedeboer - Remove aliases since we aren't supporting them in the initial version. - Update the search parameters to match what was implemented. - Correct the WebExtension dependencies. - Minor re-order of the displayed list. Differential Revision: https://phabricator.services.mozilla.com/D51405
browser/components/search/extensions/engines.json
toolkit/components/search/schema/search-engine-config-schema.json
toolkit/components/search/schema/search-engine-config-ui-schema.json
--- a/browser/components/search/extensions/engines.json
+++ b/browser/components/search/extensions/engines.json
@@ -35,18 +35,17 @@
         "default": "no"
       }, {
         "included": { "regions": ["us"] },
         "searchUrlGetParams": {
           "client": "firefox-b-1-d",
           "q": "{searchTerms}"
         },
         "telemetryId": "google-b-1-d"
-      }],
-      "aliases": ["@google"]
+      }]
     },
     {
       "engineName": "bing",
       "webExtension": {
         "id": "bing@search.mozilla.org",
         "version": "1.0"
       },
       "searchUrlGetParams": {
@@ -93,18 +92,17 @@
               "sq", "sr", "sv-SE", "th", "tl", "trs", "uk", "ur", "uz",
               "wo", "xh", "zh-CN"
             ],
             "startsWith": ["bn", "en"]
           }
         }
       }, {
         "included": { "regions": ["default"] }
-      }],
-      "aliases": ["@bing"]
+      }]
     },
     {
       "engineName": "baidu",
       "webExtension": {
         "id": "baidu@search.mozilla.org",
         "version": "1.0"
       },
       "telemetryId": "baidu",
@@ -122,18 +120,17 @@
       "appliesTo": [{
         "included": { "locales": { "matches": ["zh-CN"] } }
       }, {
         "included": {
           "regions": ["cn"],
           "locales": { "matches": ["zh-CN"] }
         },
         "default": "yes"
-      }],
-      "aliases": ["@\u767E\u5EA6", "@baidu"]
+      }]
     },
     {
       "engineName": "amazon",
       "orderHint": 500,
       "webExtension": {
         "id": "amazondotcom@search.mozilla.org",
         "version": "1.1"
       },
@@ -239,18 +236,17 @@
         "telemetryId": "amazon-en-GB",
         "searchUrlGetParams": {
           "field-keywords": "{searchTerms}",
           "ie": "{inputEncoding}",
           "mode": "blended",
           "tag": "firefox-uk-21",
           "sourceid":"Mozilla-search"
         }
-      }],
-      "aliases": ["amazon"]
+      }]
     },
     {
       "engineName": "Amazon",
       "orderHint": 500,
       "webExtension": {
         "id": "amazon@search.mozilla.org",
         "version": "1.1"
       },
@@ -368,18 +364,17 @@
               "nb-NO", "nn-NO", "pt-PT", "sq", "sr"
             ]
           }
         },
         "webExtension": {
           "locales": ["au"]
         },
         "telemetryId": "amazon-au"
-      }],
-      "aliases": ["amazon"]
+      }]
     },
     {
       "engineName": "amazoncn",
       "orderHint": 500,
       "webExtension": {
         "id": "amazondotcn@search.mozilla.org",
         "version": "1.0"
       },
@@ -390,18 +385,17 @@
         "pageletid": "headsearch",
         "searchType": "",
         "Go.x": "0",
         "Go.y": "0",
         "bestSaleNum": "0"
       },
       "appliesTo": [{
         "included": { "locales": { "matches": ["zh-CN"] } }
-      }],
-      "aliases": ["amazon"]
+      }]
     },
     {
       "engineName": "ebay",
       "orderHint": 500,
       "webExtension": {
         "id": "ebay@search.mozilla.org",
         "version": "1.0"
       },
@@ -693,18 +687,17 @@
         "telemetryId": "ebay-ch",
         "searchUrlGetParams": {
           "ff3": "4",
           "toolid": "20004",
           "campid": "5338192028",
           "customid": "",
           "mpre": "https://www.ebay.ch/sch/{searchTerms}"
         }
-      }],
-      "aliases": ["@ebay"]
+      }]
     },
     {
       "engineName": "ddg",
       "orderHint": 500,
       "webExtension": {
         "id": "ddg@search.mozilla.org",
         "version": "1.0"
       },
@@ -732,18 +725,17 @@
       }, {
         "name": "t",
         "condition": "purpose",
         "purpose": "newtab",
         "value": "ffnt"
       }],
       "appliesTo": [{
         "included": { "everywhere": true }
-      }],
-      "aliases": ["@duckduckgo", "@ddg"]
+      }]
     },
     {
       "engineName": "yandex",
       "webExtension": {
         "id": "yandex@search.mozilla.org",
         "version": "1.0"
       },
       "extraParams": [{
@@ -810,18 +802,17 @@
         },
         "telemetryId": "yandex-ru"
       }, {
         "included": { "locales": { "matches": ["tr"] }},
         "webExtension": {
           "locales": ["tr"]
         },
         "telemetryId": "yandex-tr"
-      }],
-      "aliases": ["@\u044F\u043D\u0434\u0435\u043A\u0441", "@yandex"]
+      }]
     },
     {
       "engineName": "allaannonser-sv-SE",
       "webExtension": {
         "id": "allaannonser-sv-SE@search.mozilla.org",
         "version": "1.2"
       },
       "appliesTo": [{ "included": { "locales": { "matches": ["sv-SE"]}}}]
--- a/toolkit/components/search/schema/search-engine-config-schema.json
+++ b/toolkit/components/search/schema/search-engine-config-schema.json
@@ -143,50 +143,68 @@
         },
         "searchBar": {
           "type": "string",
           "title": "Search Bar",
           "description": "SAP code for searches from the search bar."
         }
       }
     },
+    "searchUrlCodes": {
+      "type": "object",
+      "title": "Codes",
+      "description": "A map of parameter name to the parameter value.",
+      "additionalProperties": {
+        "type": "string"
+      }
+    },
     "codes": {
       "type": "object",
       "title": "Codes",
       "description": "Various codes for the search engines",
       "properties": {
-        "searchUrlGetExtraCodes": {
-          "type": "string",
-          "title": "Search URL Get Extra codes",
-          "description": "Extra params (for SAP codes) for the search URL (e.g. 'pc=foo')."
+        "searchUrlGetParams": {
+          "title": "Search URL GET Parameters",
+          "description": "Extra parameters for search URLs (e.g. 'pc=foo').",
+          "$ref": "#/definitions/searchUrlCodes"
+        },
+        "suggestUrlGetParams": {
+          "title": "Suggestion URL GET Parameters",
+          "description": "Extra parameters for search suggestion URLs (e.g. 'pc=foo').",
+          "$ref": "#/definitions/searchUrlCodes"
         },
-        "searchFormExtraCodes": {
-          "type": "string",
-          "title": "Search Form Extra codes",
-          "description": "Extra params (for SAP codes) for the search form URL (e.g. 'pc=foo')."
+        "searchUrlGetParams": {
+          "title": "Search URL POST Parameters",
+          "description": "Extra parameters for search URLs (e.g. 'pc=foo').",
+          "$ref": "#/definitions/searchUrlCodes"
+        },
+        "suggestUrlGetParams": {
+          "title": "Suggestion URL POST Parameters",
+          "description": "Extra parameters for search suggestion URLs (e.g. 'pc=foo').",
+          "$ref": "#/definitions/searchUrlCodes"
         },
         "sapCodes": {
           "$ref": "#/definitions/sapCodes"
         }
       }
     },
     "telemetryId": {
       "type": "string",
       "title": "Telemetry Id",
       "description": "The telemetry Id as used for some of SEARCH_COUNTS telemetry."
     },
     "webExtension": {
       "type": "object",
       "title": "WebExtension",
       "dependencies": {
         "id": [
-          "webExtensionVersion"
+          "version"
         ],
         "version": [
-          "webExtensionId"
+          "id"
         ]
       },
       "properties": {
         "id": {
           "type": "string",
           "title": "WebExtension Id",
           "description": "The identifier (local part) of the associated WebExtension"
         },
--- a/toolkit/components/search/schema/search-engine-config-ui-schema.json
+++ b/toolkit/components/search/schema/search-engine-config-ui-schema.json
@@ -1,15 +1,15 @@
 {
   "engineName": {
     "ui:autofocus": true
   },
   "ui:order": [
+    "engineName",
     "webExtension",
-    "engineName",
     "default",
     "defaultPrivate",
     "application",
     "orderHint",
     "telemetryId",
     "codes",
     "appliesTo"
   ]