If you are using IE7, you surely have noticed the search box in the upper right corner of the browser window. Typing something in there (you can jump to the search box by pressing Ctrl+E by the way) and pressing Enter executes the search using the configured default search engine aka SearchProvider. Right after installing IE7 there is only the Live Search SearchProvider installed and thus set as default.
Today I’ll show you how to
- Add more predefined SearchProviders
- Create your own SearchProvider
- Adding a SearchProvider from inside an HTML-page
- Exporting SearchProviders for backup purposes
Adding predefined SearchProviders
It will not become any easier: Just open the SearchProvider drop-down list by clicking the small arrow or by pressing Ctrl+Down, then click on Find More Providers.
You’ll end up on a webpage allowing you to add some new Providers:
After clicking on a SearchProvider entry, you get the following dialog, asking you if you really want to add it.
You can also choose to make this Provider the default.
But what if the SearchProvider you are looking for doesn’t exist?
Creating your own SearchProvider
Creating a SearchProvider for a search engine of your choice is just as simple as adding a predefined one: On the right side of the webpage showing the predefined Providers, you see a yellow box providing you with some instructions for creating your own.
Adding a SearchProvider from inside an HTML-page
If you are hosting a website with your own search engine onboard, you can simply call
window.external.AddSearchProvider(http://www.example.com/provider.xml);
when a user clicks on a link on your website spawning the Add Search Provider dialog as seen above. Note that this dialog cannot be spawned automatically by a website. I will be blocked by the pop-up blocker!
You have to provide some XML code for the SearchProvider. Let’s take a short look at that format.
You see, that it relies on the OpenSearch specification from a9.com (amazon’s search engine). The template attribute of the Url-tag contains the URL to perform the search where {searchTerms} is replaced by the actual search terms.
More information on this can be found at
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/external/overview/ie7_opensearch_ext.asp.
Exporting SearchProviders for backup purposes
After adding and defining your SearchProvider collection, you should make a backup just in case. To do that, simply export the registry key located under
HKEY_CURRENT_USERSoftwareMicrosoftInternet ExplorerSearchScopes
That’s it!