I have to develop an extension which adds a new search engine and sets it as default.
I have not found anything in https://developer.chrome.com/extensions/
Is it possible?
You cannot set the default search engine to an extension-defined search engine:
Allowing an extension-added engine to be default is problematic because there's no clear fallback path for when the extension is uninstalled -- especially if the previous default (or worse, all other engines) are deleted first. This could allow us to get into a "no engine as default" case which Chrome isn't prepared to handle.
Chrome does support keywords directly, e.g. add a search engine for Wikipedia and make the keyword "w", and "w foo" will search Wikipedia for foo. Perhaps you can use this native capability as a workaround?
You can add a new keyword-based search provider via the chrome.omnibox API (but you cannot make it the default).
It is now possible to create a new search engine and even set it as default; however, the method to do so it only available on Windows according to Chrome docs:
Settings overrides are a way for extensions to override selected Chrome settings. The API is available only on Windows.
The gist is as follows: if your extension's Web Store listing is associated to the verified domain used in search, you can specify it in the manifest.
That means you can only do so if you control the search engine page to the point of being able to verify it for your account in Webmaster Tools.
The following is a minimal configuration:
"chrome_settings_overrides": {
"name": "Example search",
"keyword": "example",
"search_url": "https://example.com/s?={searchTerms}",
"favicon_url": "https://example.com/favicon.ico",
"encoding": "UTF-8",
"default": true
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With