OpenSearch, how to get Google Chrome to search your site.

Ever wonder how sites like battle.net support things like this in Google Chrome?

Well I did, so I did a little bit of digging. It turns out Google Chrome supports an open standard called Open Search. This format is relatively simple, and very easy to add to your own site. I just added it to some of our systems in under 5 minutes.


Adding OpenSearch to your site is incredibly simple, you just have to add a simple tag to your index HTML page, and add a simple XML file that it points to. The link tag looks like this:

<link rel="search" type="application/opensearchdescription+xml" href="http://my-site.com/opensearch.xml" title="MySite Search" />


The opensearch.xml file looks something like this:


<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
   <ShortName>My Site</ShortName>
   <Description>Search My Site</Description>
   <Url type="text/html" method="get" template="http://my-site.com/search?{searchTerms}"/>
   <Image height="16" width="16" type="image/vnd.microsoft.icon">
http://my-site.com/favicon.ico
   </Image>
   <moz:SearchForm>http://my-site/search</moz:SearchForm>
   <Url type="application/opensearchdescription+xml" rel="self" template="http://my-site.com/opensearch.xml"/>
</OpenSearchDescription>




And that's all, the first time someone visits your site, the link tag will be registered, and following attempts to type in that URL will provide them with the option to search (chrome), and it will nicely integrate with other search services as well.

Comments

Hello!

The A9 spec is not functioning anymore.
What we will do?

Look: http://a9.com/-/spec/opensearch/1.1/

Thanks a lot for help!
AndrewBassett said…
Good day! This is sort of off topic but I need some advice from an established post. Can it be tough to set up your personal post? I'm not very techincal but I can figure things out pretty quick. I'm contemplating setting up my very own but I'm uncertain where you should start. Are you experiencing any ideas or suggestions? Thanks Air Ambulance
Unknown said…
I can't see any reference to rel="search" or "opensource" or anything of the sort on auctions.yahoo.co.jp, yet Chrome somehow detects the search on that site. So there must be one more way that this works, even if it's Chrome having a giant hard-coded list of sites and where their search URLs are.
Qasim Khan said…
i really love your post, thanks for sharing Attitude Poetry
Herryjony said…
Searching for online class help near me? Take your online classes has the Pay Someone To Do Your Class Online who provide instant help with online classes, courses & exams.
All of the experts on our team are pre-screened buy papers online and have at least 1+ years of experience in helping students achieve academic success. See how we select our employees.
MichelAnthony said…
This is the first time that I visit here. I found so many exciting matters in this particular blog, One thing I would like to request you that pls keep posting such type of informative blog.
Site:https://fortunejackets.com/product/venice-locals-only-work-jacket
Anonymous said…
It really works! I found an online site that provides writing assistance; from where I have been taking Business Dissertation Help for quite some time by the guidance of this open search bar. If you can state your requirements with clarity and precision then it’ll present you with the result accordingly.
Patherjackets said…
we offer our customers the most affordable prices in town. Panther Jackets is the place you wanna be. We deal with jackets of all types. We intend to provide our customers with the most premium quality jackets.

Singer Rihanna
Hunter Boots
Rihanna Pink Silk Long Puffer Coat
Charlie Hunnam The Gentlemen
Remer Mirror said…
I'm extremely inspired along with your writing skills as neatly as with the format in your blog. Is that a paid subject or did you customize it yourself? Anyway stay up the excellent quality writing, it's rare to look at a great blog like this one today.. www.remer.com.au
William said…
If you are looking for the professional logo design services, I recommend you logoistic. They have highly qualified and experienced logo designers who promise to deliver high-quality content.
Thanks for providing that amazing platform, I appreciate the time and effort you took into putting everything together. You're in fortunate if you're reading this since you may engage our organization to finish your project and relieve you of the stress of writing to write my essay! Thank you for making this information available.
Oliver Beth said…
I found this platform, when I was just looking to find out that how to watch simpsons on fox from anywhere, and it's wonderful and quite informative, thanks for sharing.
EvelynAdam said…
I was writing the whole assignment in my college on it, actually I am working with Vpnsports services providers, and we are offering Argentina vs Mexico Live Stream, who worried about to watch it, can access easily.