Adding search engines from web pages

Firefox allows JavaScript code to install search engine plugins to the search box using OpenSearch.

When JavaScript code attempts to install a search plugin, Firefox presents an alert asking the user for permission to install the plugin.

This method is not widely supported. The preferred method of exposing OpenSearch is to use search plugin autodiscovery.

Installing OpenSearch plugins

To install an OpenSearch plugin, use the window.external.AddSearchProvider() DOM method. The syntax for this method is:

window.external.AddSearchProvider(engineURL);

Where engineURL is the absolute URL to the XML file for the search engine plugin.