Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to mark a search box for chrome to detect and install in its "Other search engines"?

When I start typing in chrome the names of the following sites:

  • Amazon
  • Newegg
  • Imdb
  • Quora
  • many others...

I can hit "tab" and chrome lets me search with that site's specific search engine. What kind of HTML` do I add to a <form> to help chrome automatically detect a search box in a site I made? Can I control the keyword chosen?

I found this chrome doc talking about the feature from the user POV but not from the webmaster's. They call it "Search a specific site (tab to search)". Btw, google maps used to have this feature but recently it's died for some reason.

like image 652
ubershmekel Avatar asked Nov 06 '12 09:11

ubershmekel


1 Answers

I finally found an explanation about chromium at http://www.chromium.org/tab-to-search

Basically you need to link to an OpenSearch description document.

<head>
    <link type="application/opensearchdescription+xml" rel="search" href="url_of_osdd_file"/>
</head>

And this is the osdd file:

<?xml version="1.0"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>Search My Site</ShortName>
    <Description>Search My Site</Description>
    <Url type="text/html" method="get" template="http://my_site/{searchTerms}"/>
</OpenSearchDescription>
like image 87
ubershmekel Avatar answered Oct 07 '22 11:10

ubershmekel