-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MB 213: Customize the search engines list
- Loading branch information
Showing
14 changed files
with
220 additions
and
24 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
{ | ||
"name": "Brave Search", | ||
"manifest_version": 2, | ||
"version": "1.0", | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
}, | ||
"hidden": true, | ||
"icons": { | ||
"16": "favicon.svg", | ||
"32": "favicon.svg", | ||
"96": "favicon.svg", | ||
"128": "favicon.svg" | ||
}, | ||
"web_accessible_resources": [ | ||
"favicon.svg" | ||
], | ||
"chrome_settings_overrides": { | ||
"search_provider": { | ||
"name": "Brave Search", | ||
"keyword": ["@brave", "@bv"], | ||
"search_form": "https://search.brave.com/search", | ||
"search_url": "https://search.brave.com/search", | ||
"search_url_get_params": "q={searchTerms}", | ||
"suggest_url": "https://search.brave.com/api/suggest", | ||
"suggest_url_get_params": "q={searchTerms}" | ||
} | ||
} | ||
} |
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
browser/components/search/extensions/ddg-html/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "DuckDuckGo HTML", | ||
"description": "Search DuckDuckGo HTML", | ||
"manifest_version": 2, | ||
"version": "1.4", | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
}, | ||
"hidden": true, | ||
"icons": { | ||
"16": "favicon.ico" | ||
}, | ||
"web_accessible_resources": ["favicon.ico"], | ||
"chrome_settings_overrides": { | ||
"search_provider": { | ||
"keyword": ["@duckduckgohtml", "@ddgh"], | ||
"name": "DuckDuckGo HTML", | ||
"search_url": "https://html.duckduckgo.com/html/", | ||
"search_form": "https://html.duckduckgo.com/html/", | ||
"search_url_get_params": "q={searchTerms}", | ||
"suggest_url": "https://duckduckgo.com/ac/", | ||
"suggest_url_get_params": "q={searchTerms}&type=list" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
browser/components/search/extensions/metager/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "MetaGer (en)", | ||
"manifest_version": 2, | ||
"version": "1.0", | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
}, | ||
"hidden": true, | ||
"icons": { | ||
"16": "favicon.ico", | ||
"32": "favicon.ico", | ||
"96": "favicon.ico", | ||
"128": "favicon.ico" | ||
}, | ||
"web_accessible_resources": [ | ||
"favicon.ico" | ||
], | ||
"chrome_settings_overrides": { | ||
"search_provider": { | ||
"name": "MetaGer", | ||
"keyword": ["@metager", "@mg"], | ||
"search_url": "https://metager.org/meta/meta.ger3?eingabe={searchTerms}" | ||
} | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "Mojeek", | ||
"manifest_version": 2, | ||
"version": "1.0", | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
}, | ||
"hidden": true, | ||
"icons": { | ||
"16": "favicon.ico", | ||
"32": "favicon.ico" | ||
}, | ||
"web_accessible_resources": ["favicon.ico"], | ||
"chrome_settings_overrides": { | ||
"search_provider": { | ||
"keyword": ["@mj", "@mojeek"], | ||
"name": "Mojeek", | ||
"search_url": "https://www.mojeek.com/search", | ||
"search_url_get_params": "q={searchTerms}" | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
browser/components/search/extensions/mullvad-leta/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions
26
browser/components/search/extensions/mullvad-leta/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "Mullvad Leta", | ||
"manifest_version": 2, | ||
"version": "1.0", | ||
"browser_specific_settings": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
}, | ||
"hidden": true, | ||
"icons": { | ||
"16": "favicon.svg", | ||
"32": "favicon.svg", | ||
"96": "favicon.svg", | ||
"128": "favicon.svg" | ||
}, | ||
"web_accessible_resources": ["favicon.svg"], | ||
"chrome_settings_overrides": { | ||
"search_provider": { | ||
"keyword": ["@leta", "@mullvad", "@ml"], | ||
"name": "Mullvad Leta", | ||
"search_url": "https://leta.mullvad.net/", | ||
"search_url_get_params": "q={searchTerms}" | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
browser/components/search/extensions/startpage/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "Startpage", | ||
"description": "Startpage", | ||
"manifest_version": 2, | ||
"version": "1.0", | ||
"applications": { | ||
"gecko": { | ||
"id": "[email protected]" | ||
} | ||
}, | ||
"hidden": true, | ||
"icons": { | ||
"16": "favicon.png" | ||
}, | ||
"web_accessible_resources": [ | ||
"favicon.png" | ||
], | ||
"chrome_settings_overrides": { | ||
"search_provider": { | ||
"name": "Startpage", | ||
"keyword": ["@startpage", "@sp"], | ||
"search_url": "https://www.startpage.com/sp/search", | ||
"search_form": "https://www.startpage.com/sp/search/", | ||
"search_url_post_params": "q={searchTerms}" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1327,11 +1327,6 @@ export class SearchService { | |
|
||
let result = Cr.NS_OK; | ||
try { | ||
// Create the search engine selector. | ||
this.#engineSelector = new lazy.SearchEngineSelector( | ||
this.#handleConfigurationUpdated.bind(this) | ||
); | ||
|
||
// See if we have a settings file so we don't have to parse a bunch of XML. | ||
let settings = await this._settings.get(); | ||
|
||
|
@@ -2278,23 +2273,18 @@ export class SearchService { | |
// This is prefixed with _ rather than # because it is | ||
// called in test_remove_engine_notification_box.js | ||
async _fetchEngineSelectorEngines() { | ||
let searchEngineSelectorProperties = { | ||
locale: Services.locale.appLocaleAsBCP47, | ||
region: lazy.Region.home || "default", | ||
channel: lazy.SearchUtils.MODIFIED_APP_CHANNEL, | ||
experiment: | ||
lazy.NimbusFeatures.searchConfiguration.getVariable("experiment") ?? "", | ||
distroID: lazy.SearchUtils.distroID ?? "", | ||
}; | ||
|
||
for (let [key, value] of Object.entries(searchEngineSelectorProperties)) { | ||
this._settings.setMetaDataAttribute(key, value); | ||
} | ||
|
||
let { engines, privateDefault } = | ||
await this.#engineSelector.fetchEngineConfiguration( | ||
searchEngineSelectorProperties | ||
); | ||
const engines = [ | ||
{ webExtension: { id: "[email protected]" }, orderHint: 100 }, | ||
{ webExtension: { id: "[email protected]" }, orderHint: 90 }, | ||
{ | ||
webExtension: { id: "[email protected]" }, | ||
orderHint: 80, | ||
}, | ||
{ webExtension: { id: "[email protected]" }, orderHint: 70 }, | ||
{ webExtension: { id: "[email protected]" }, orderHint: 60 }, | ||
{ webExtension: { id: "[email protected]" }, orderHint: 50 }, | ||
{ webExtension: { id: "[email protected]" }, orderHint: 40 }, | ||
]; | ||
|
||
for (let e of engines) { | ||
if (!e.webExtension) { | ||
|
@@ -2304,7 +2294,7 @@ export class SearchService { | |
e.webExtension?.locale ?? lazy.SearchUtils.DEFAULT_TAG; | ||
} | ||
|
||
return { engines, privateDefault }; | ||
return { engines, privateDefault: undefined }; | ||
} | ||
|
||
#setDefaultAndOrdersFromSelector(engines, privateDefault) { | ||
|