How does a website tell the browser it is a search engine which can be added as a search engine?

I'd like to make a page with a get parameter which contains search keywords. When I enter a website firefox recognises appropriate websites which have search capabilities and allow you to add them with a few clicks. (the drop down menu on the address bar) How can my website tell firefox or chrome that it has a search function that everybody can use from browser address bar or omnibar of chrome?

Upvotes: 2

Views: 113

Answers (1)

Neil Kennedy
Neil Kennedy

Reputation: 603

You'll need this meta tag

 <link rel="search" type="application/opensearchdescription+xml" href="[your url]/opensearch.xml" title="[Your title]" /> 

You can find more information here http://www.opensearch.org/Home

Your xml file will look like

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>[Name]</ShortName>
    <Description>[Desc]</Description>
    <Image height="16" width="16" type="image/x-icon">[ico]</Image>
    <Image height="64" width="64" type="image/png">[png]</Image>
    <Url type="text/html" method="get" template="[url]/?q={searchTerms}"/>
    <Url type="application/opensearchdescription+xml" rel="self" template="[url]/opensearch.xml"/>
</OpenSearchDescription>

Upvotes: 4

Related Questions