开发者

Have your WebSite recognized as a Search Engine by Chrome

开发者 https://www.devze.com 2022-12-21 21:12 出处:网络
If I st开发者_JAVA技巧art typing stackov.. in Chrome I can see something like \'Press Tab to search

If I st开发者_JAVA技巧art typing stackov.. in Chrome I can see something like 'Press Tab to search stackoverflow.com'.

SO is basically recognized as a Search Engine.

Do you have any idea of how to implement the same sort of feature in our WebApp?

I think it should be related with OpenSearch

<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="http://sstatic.net/so/opensearch.xml">

thanks

edit:

I think it should be just a matter of specifing an xml defined in this way (http://sstatic.net/so/opensearch.xml)

    <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"

                       xmlns:moz="http://www.mozilla.org/2006/browser/search/"> 
  <ShortName>Stack Overflow</ShortName> 
  <Description>Search stackoverflow.com for answers to your programming questions</Description> 
  <InputEncoding>UTF-8</InputEncoding> 
  <Image width="16" height="16" type="image/x-icon">http://stackoverflow.com/favicon.ico</Image> 
  <Url type="text/html" method="get" template="http://stackoverflow.com/search?q={searchTerms}"></Url> 
</OpenSearchDescription>

and this is the URL that will be used.

http://stackoverflow.com/search?q={searchTerms}

searchTerms will be populated with the string you typed-in in chrome


Yes, you're on the right track there. It's OpenSearch you're looking for. They have some how-to guides and tutorials on how to implement this on your own website.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号