chrome_settings_overrides
| Type | Object |
|---|---|
| Mandatory | No |
| Manifest version | 2 or higher |
| Example | json |
Use the chrome_settings_overrides key to override the browser's home page and add a new search engine.
Syntax
The chrome_settings_overrides key is an object that may have the following properties:
homepage-
string. Defines the page to be used as the browser's homepage.The replacement is given as a URL. The URL may:
- point to a file bundled with the extension, in which case it is given as a URL relative to the manifest.json file
- be a remote URL, such as "https://developer.mozilla.org/".
If two or more extensions both set this value, then the setting from the most recently installed one will take precedence.
To override new tabs, use chrome_url_overrides instead.
This is a localizable property.
search_provider-
object. Defines a search provider to add to the browser.The search provider has a name and a primary search URL. Alternative URLs may be provided, including URLs for more specialized searches like image search. In the URL you supply, use
{searchTerms}to interpolate the search term into the URL, like:https://www.discogs.com/search/?q={searchTerms}. You can also provide POST parameters to be sent along with the search.The search provider will be presented to the user alongside the built-in providers. If you include the
is_defaultproperty and set it totrue, the new search provider will be the default option. By supplying thekeywordproperty, you enable the user to select your search provider by typing the keyword into the search/address bar before the search term.This object has these properties. All string properties are localizable.
name-
string. The search engine's name, displayed to the user. search_url-
string. URL used by the search engine. This must be an HTTPS URL. is_defaultOptional-
boolean. True if the search engine should be the default choice. On Firefox, this is opt-in and the user will only be asked the first time the extension is installed. They will not be asked again if a search engine is added later. alternate_urlsOptional-
arrayofstring. An array of alternative URLs that can be used instead ofsearch_url. encodingOptional-
string. Encoding of the search term, specified as a standard character encoding name, such as "UTF-8". favicon_urlOptional-
string. URL pointing to an icon for the search engine. In Manifest V2, this must be an absolute HTTP or HTTPS URL. In Manifest V3, this must reference an icon provided in the extension as a path relative to the extension's root. image_urlOptional-
string. URL used for image search. image_url_post_paramsOptional-
string. POST parameters to send toimage_url. instant_urlOptional-
string. URL used for instant search. instant_url_post_paramsOptional-
string. POST parameters to send toinstant_url. keywordOptional-
string. Address bar keyword for the search engine. prepopulated_idOptional-
string. The ID of a built-in search engine to use. search_url_get_paramsOptional-
string. GET parameters to send tosearch_url. Available only in Firefox, for optimal cross-browser compatibility usesearch_urlinstead. search_url_post_paramsOptional-
string. POST parameters to send tosearch_url. suggest_urlOptional-
string. URL used for search suggestions. This must be an HTTPS URL. suggest_url_get_paramsOptional-
string. GET parameters to send tosuggest_url. Available only in Firefox, for optimal cross-browser compatibility usesuggest_urlinstead. suggest_url_post_paramsOptional-
string. POST parameters to send tosuggest_url.
Example
This example shows how to set a search provider.
"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"
}
}