mauris
mauris

Reputation: 43619

Is there anyway to detect whether a specific Opensearch search engine has been added to the browser?

I am currently working on an application that requires to check whether the Opensearch has been added.

I've successfully done the code that adds the search engine of my application to the browser via Opensearch XML file. but I wish to detect whether the search engine is currently installed or not.

Upvotes: 0

Views: 511

Answers (1)

Jack Leow
Jack Leow

Reputation: 22487

It's not really all that cross browser (which isn't that surprising, since search provider support isn't really a basic browser feature), but you can use:

window.external.IsSearchProviderInstalled(url);

Which returns:

0 - The specified search provider is not installed for the current user.

1 - The specified search provider is installed for the current user.

2 - The specified search provider is installed and is set as the default search provider.

Documented here - http://msdn.microsoft.com/en-us/library/aa744118%28VS.85%29.aspx. Firefox 3 seems to support it also.

Upvotes: 4

Related Questions