How to Add Google Chrome Omnibox-Search Support for Your Site

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="/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.

How to make a website searchable by chrome?

So the thing youre talking about is called omnibox, and here's a link to a similar question which includes loads of detailed answers: How to add google chrome omnibox-search support for your site?

Hope this helps.

Edit: For those reading wondering why they can't replicate the facebook example given in the question, omnibox doesnt always work for everyone, its always been iffy on my work computer but works perfectly at home, I believe its something to do with the browser settings (official advice is just to reset them and try again!)

Why isn't Chrome enabling Omnibox Search for my site?

Chrome Bug Report 58801 is a place where someone had asked a similar question. The comment #3 Comment 3 answers that one needs to search before the engine is added.

I set up a test site

  • visit it
  • Click the OK button to perform a mock search
  • type "testSiteName.com" + on your omni box
  • you should see a "testSiteName search"
  • I got my osdd file from youtube.

This seems to be working for me.

Afterthought: If you want to test something anew, visit chrome://chrome/settings and manage search engines. Delete the search engine of your site and restart the browser. My chrome was displaying the old search till I restarted the browser.

Enable Tab to search in a website

You have to serve an opensearch xml, and link to it in your <head> tag. See the specs here:

https://github.com/dewitt/opensearch

And a user friendly description here:

https://developer.mozilla.org/en-US/docs/Web/OpenSearch

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

Getting OSD (OpenSearchDescription) work under Google Chrome or IE7 / IE8 isn't as difficult as mentioned or that these browsers don't support POST requests.

With a little bit of tweaking, I found a workaround to the entire problem.

My initial code:

<Url type="text/html" method="POST" template="http://MySite.com/query.php">
<Param name="sString" value="{searchTerms}"/>
</Url>

This code points directly to the query page and passes the value for the sString attribute on my POST request.

That works perfectly on FireFox but doesn't quite work well on IE7/IE8 or Google Chrome (I didn't test with Opera or Safari yet..).


Altering the code to the following piece:

<Url type="text/html" template="http://MySite.com/query.php?sString={searchTerms}"></Url>
  • Removing method="POST" from the element
  • Replacing /query.php with the actual page call: /query.php?sString={searchTerms}
  • Removing the now unnecessary "<Param name="sString" value="{searchTerms}"/>"

Resolved my problem of incompatibility with those browsers.

All calls are directly headed to the query page and even it initially was a POST request, it now work on both IE7/IE8 and Google Chrome.

Thanks again adrianbanks for providing me with your xml file which led to the solution!

Add JIRA Quick Search to Chrome Omnibox

In newer versions of JIRA (I'm using 6.2.7), the URL to use is https://jira.example.com/secure/QuickSearch.jspa?searchString=%s (replace jira.example.com with your host name).

Update: In JIRA 6.4.4, this URL works: https://jira.example.com/issues/?jql=%s

enable pressing tab to search in google chrome on my website

Here is opensearch.xml example that works for me:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
<ShortName>Example.com</ShortName>
<LongName>Example.com Search</LongName>
<Description>Search through Example.com</Description>
<Query role="example" searchTerms="example search"/>
<InputEncoding>UTF-8</InputEncoding>
<OutputEncoding>UTF-8</OutputEncoding>
<AdultContent>false</AdultContent>
<Language>en-us</Language>
<SyndicationRight>open</SyndicationRight>
<Developer>Example.com</Developer>
<Tags>tag1,tag2</Tags>
<Image height="16" width="16" type="image/vnd.microsoft.icon">http://example.com/favicon.ico</Image>
<Url type="text/html" template="http://example.com/search.html?q={searchTerms}"/>
<Url type="application/x-suggestions+json" template="http://example.com/suggestions.html?query={searchTerms}"/>
</OpenSearchDescription>

I think localhost and/or non-standard port 3000 might also contribute to the problem.



Related Topics



Leave a reply



Submit