AddSearchProvider method

Warning  This method has been deprecated since Internet Explorer 8 and removed from Windows 10.

 

Adds a search provider to the registry.

Deprecated. This method is not supported for Windows apps using JavaScript.

Syntax

HRESULT retVal = object.AddSearchProvider(URL);

Parameters

  • URL [in]
    Type: BSTR

    String that specifies an absolute or relative URL to the OpenSearch Description file for the search provider.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

There are no standards that apply here.

Remarks

As of Internet Explorer 10, this method will only return S_OK.

IShellUIHelper2::AddSearchProvider was introduced in Windows Internet Explorer 7.

This method opens a dialog box that enables the user to add the provider to their registry, and optionally set it as the default search provider. The maximum number of search providers that can be installed is 200.

The URL parameter allows http:, https:, or ftp: protocol schemes only. Additionally, the URL must be in a security zone that permits downloading.

Search providers must use the HTTP GET request method; the POST request method is not supported.

Syntax of "Provider.xml" must be of valid XML format. Be sure to encode all characters in the query string. Perticularly, escaping "&" to "&".

The query string must contain "q={searchTerms}" somewhere within the query string. When Windows Internet Explorer 8 navigates to the provider to get search results, "{searchTerms}" will be replaced by the query string that the user typed into the Instant Search box.

When using an embedded link, the value of "rel" attribute must be set to "search" and the value of "type" attribute must be set to "application/opensearchdescription+xml".

Ensure the "title" advertised in the link tag represents the same string as the "ShortName" used by the XML description file. These strings must match to indicate that the provider has been installed. This will prevent users from installing your search provider multiple times under different names.

See also

Reference

IopenService

IShellUIHelper2::IsSearchProviderInstalled

Conceptual

Search Provider Extensibility in Internet Explorer