How to add google chrome omnibox-search support for your site?

Chrome usually handles this through user preferences. (via chrome://settings/searchEngines)

However, if you’d like to implement this specifically for your users, you need to add a OSD (Open Search Description) to your site.

Making usage of Google Chrome’s OmniBox [TAB] Feature for/on personal website?

You then add this XML file to the root of your site, and link to it in your <head> tag:

<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="https://stackoverflow.com/opensearch.xml" />

Now, visitors to your page will automatically have your site’s search information placed into Chrome’s internal settings at chrome://settings/searchEngines.

OpenSearchDescription XML Format Example

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>Your website name (shorter = better)</ShortName>
<Description>
Description about your website search here
</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">your site favicon</Image>
<Url type="text/html" method="get" template="http://www.yoursite.com/search/?query={searchTerms}"/>
</OpenSearchDescription>

The important part is the <url> item. {searchTerms} will be replaced with what the user searches for in the omnibar.

Here’s a link to OpenSearch for more information.

Leave a Comment