Reputation: 3789
When I write "stackoverflow.com" or "bing.com" and then space in google chrome URL, it adds "search stackoverflow" or "search bing".
So what do we need to implement in our web app to make google chrome do this?
Note: I found stackoverflow and bing as search engine added. I haven't added it. So must be a way to ask to add it as search engine from web app.
Upvotes: 3
Views: 1158
Reputation: 4882
You will need to create opensearch xml document for your website, and then link
through your page head
.
Example, this is how it is designed for stackoverflow:
<head>
<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml">
</head>
**OpenSearch xml **
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<script/>
<ShortName>Stack Overflow</ShortName>
<Description>
Search Stack Overflow: Q&A for professional and enthusiast programmers
</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16" type="image/x-icon">
https://cdn.sstatic.net/Sites/stackoverflow/img/favicon.ico?v=4f32ecc8f43d
</Image>
<Url type="text/html" method="get" template="http://stackoverflow.com/search?q={searchTerms}"/>
</OpenSearchDescription>
You can check more examples with Youtube, Github etc popular search repositories. Also refer this chromium tab-to-search project for more details.
Upvotes: 8