简体   繁体   中英

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.

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM