Skip to content

Instantly share code, notes, and snippets.

@nt1m
Last active February 26, 2017 07:47
Show Gist options
  • Save nt1m/cad0b5afb35785d051785a51a4f6cf98 to your computer and use it in GitHub Desktop.
Save nt1m/cad0b5afb35785d051785a51a4f6cf98 to your computer and use it in GitHub Desktop.
Search engines proposal

Adding new search engines: the search_engine manifest field

{
  "search_engine": "opensearch.xml"
}

Managing search engines: the browser.searchEngines namespace

- browser.searchEngines.remove()
Removes a built-in search engine
- browser.searchEngines.list()
Returns an iterator/array of Engine objects
- browser.searchEngines.disable()
Disables a search engine
- browser.searchEngines.enable()

The Engine object

{
  name,
  opensearchURL,
  url,
  method: "GET/POST"
  ??
}

Other API possibility

Extend chrome.management to support querying engines

@Smile4ever
Copy link

An attribute for the icon is missing.

@Smile4ever
Copy link

Also, a way to set the default search engine needs to be thought of. This can be implemented by adding a property default to the object and then calling browser.searchEngines.update or by creating a function setDefault.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment