How is the function external.IsSearchProviderInstalled meant to be used? I've tried things like external.IsSearchProviderInstalled('http://www.google.com') but I keep getting an Error in Chrome?
What is the function external.IsSearchProviderInstalled? How should it be used in Chrome?
The spec for IsSearchProviderInstalled is here: http://dev.w3.org/html5/spec-author-view/system-state-and-capabilities.html#dom-external-issearchproviderinstalled
The most likely reason you are getting an error is because "Only results pages on the same domain as the script that calls this method are checked." So you can only check if providers on your domain are installed.
e.g. If you go to https://www.google.com, open the Javascript console and say
external.IsSearchProviderInstalled('https://www.google.com') you'll get back a 0, 1 or 2 depending on your search provider settings.
However, if you try the same call on a different domain, an Error is thrown. It is a poorly defined generic error, but there is a FIXME in the Chromium code to respond with something more descriptive (c.f. ExternalExtensionWrapper::IsSearchProviderInstalled in src/chrome/renderer/external_extension.cc)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With