Windows 7 / Getting Started

How to Create a Web Link to Add a Custom Search Provider

You can publish a link on a Web page to allow users to add a custom search engine.

First, create an OpenSearch 1.1 Extensible Markup Language (XML) file that describes your search engine.

For example, the following XML file describes a search engine that can be used to search the Microsoft.com Web site.



<?xml version="1.0" encoding="UTF-8" ?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>Microsoft.com</ShortName>
    <Description>Microsoft.com provider</Description>
    <InputEncoding>UTF-8</InputEncoding>
    <Url type="text/html"
    template="http://search.microsoft.com/results.aspx?q={searchTerms}" />
</OpenSearchDescription>

To create your own OpenSearch XML document, simply replace the template attribute in the <URL> element with the URL of your search engine, inserting {searchTerms} at the location in the URL where search terms appear.

Note For detailed information about OpenSearch documents, visit http://www.opensearch.org/home.

After you create an OpenSearch XML document, you can allow users to add it from a Web page by using a window.external.AddSearchProvider("<URL>") call within a link. When users click the link, they will be prompted to add the search engine. The following example demonstrates the required HTML. (You must replace "<URL>" with the location of your OpenSearch XML document.)

<a Href="#"
    onClick="window.external.AddSearchProvider(&quot;<URL>&quot;);">Add Search Engine
</a>
[Previous] [Contents] [Next]

In this tutorial:

  1. Managing Windows Internet Explorer
  2. Internet Explorer 8 Improvements
  3. InPrivate Browsing
  4. InPrivate Filtering
  5. Compatibility View
  6. SmartScreen
  7. Domain Highlighting
  8. Tab Isolation
  9. Accelerators
  10. Improvements Previously Introduced in Internet Explorer 7
  11. User Interface Changes
  12. Tabbed Browsing
  13. Search Bar
  14. How to Create a Web Link to Add a Custom Search Provider
  15. How to Configure Custom Search Providers Using the Registry
  16. How to Configure Custom Search Providers Using Group Policy
  17. RSS Feeds
  18. Improved Standards Support
  19. Expanded Group Policy Settings
  20. Defending Against Malware
  21. How Protected Mode Improves Security
  22. How the Protected Mode Compatibility Layer Works
  23. How to Solve Protected Mode Incompatibilities
  24. URL-Handling Protection
  25. Address Bar Visibility
  26. Cross-Domain Scripting Attack Protection
  27. Controlling Browser Add-ons
  28. Add -on Manager Improvements
  29. Protecting Against Data Theft
  30. Security Status Bar
  31. How the Smart Screen Filter Works
  32. How to Configure Smart Screen Options
  33. Deleting Browsing History
  34. Blocking IDN Spoofing
  35. Security Zones
  36. Understanding Zones
  37. Configuring Zones on the Local Computer
  38. Configuring Zones Using Group Policy
  39. Network Protocol Lockdown
  40. Managing Internet Explorer Using Group Policy
  41. Group Policy Settings for Internet Explorer 7 and Internet Explorer 8
  42. New Group Policy Settings for Internet Explorer 8
  43. Using the Internet Explorer Administration Kit
  44. Troubleshooting Internet Explorer Problems
  45. Internet Explorer Does Not Start
  46. An Add-on Does Not Work Properly
  47. Some Web Pages Do Not Display Properly
  48. Preventing Unwanted Toolbars
  49. The Home Page or Other Settings Have Changed