mirror of
https://github.com/mdn/webextensions-examples.git
synced 2026-04-16 06:18:35 +02:00
Use a single manifest file for Firefox and Chrome (#236)
This commit is contained in:
@@ -9,9 +9,3 @@ It also adds a keyword "disc", so you can type "disc Model 500" and get the disc
|
||||
## What it shows
|
||||
|
||||
How to use the [`chrome_settings_overrides`](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/chrome_settings_overrides) manifest key to define a new search engine.
|
||||
|
||||
Note that Chrome mandates the `is_default` property, and `encoding` must also be included unless `prepopulated_id` is set. Since none of these properties are yet supported in Firefox, it's not possible to write a single manifest.json that works in both browsers. So this example includes three manifest*.json files:
|
||||
|
||||
* manifest-chrome.json: works in Chrome. Rename this to manifest.json to use Chrome.
|
||||
* manifest-firefox.json: works in Firefox.
|
||||
* manifest.json: the default. The same as manifest-firefox.json
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
{
|
||||
|
||||
"manifest_version": 2,
|
||||
"name": "Discogs search engine",
|
||||
"description": "Adds a search engine that searches discogs.com",
|
||||
"version": "1.0",
|
||||
|
||||
"chrome_settings_overrides": {
|
||||
"search_provider": {
|
||||
"name": "Discogs",
|
||||
"search_url": "https://www.discogs.com/search/?q={searchTerms}",
|
||||
"keyword": "disc",
|
||||
"favicon_url": "https://www.discogs.com/favicon.ico",
|
||||
"is_default": false,
|
||||
"encoding": "UTF-8"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
|
||||
"manifest_version": 2,
|
||||
"name": "Discogs search engine",
|
||||
"description": "Adds a search engine that searches discogs.com",
|
||||
"version": "1.0",
|
||||
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"strict_min_version": "55"
|
||||
}
|
||||
},
|
||||
|
||||
"chrome_settings_overrides": {
|
||||
"search_provider": {
|
||||
"name": "Discogs",
|
||||
"search_url": "https://www.discogs.com/search/?q={searchTerms}",
|
||||
"keyword": "disc",
|
||||
"favicon_url": "https://www.discogs.com/favicon.ico"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,19 +4,19 @@
|
||||
"name": "Discogs search engine",
|
||||
"description": "Adds a search engine that searches discogs.com",
|
||||
"version": "1.0",
|
||||
|
||||
"applications": {
|
||||
"gecko": {
|
||||
"strict_min_version": "55"
|
||||
}
|
||||
},
|
||||
|
||||
"chrome_settings_overrides": {
|
||||
"search_provider": {
|
||||
"name": "Discogs",
|
||||
"search_url": "https://www.discogs.com/search/?q={searchTerms}",
|
||||
"keyword": "disc",
|
||||
"favicon_url": "https://www.discogs.com/favicon.ico"
|
||||
"favicon_url": "https://www.discogs.com/favicon.ico",
|
||||
"is_default": false,
|
||||
"encoding": "UTF-8"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user