views:

114

answers:

1

Hi all. 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.

+1  A: 

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.

Jack Leow