Is it possible to change the default search engine with a Google Chrome extension?

google-chrome-devtools, google-chrome-extension, javascript

Solution

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).

Problem

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?

Original source