让您的网站被 Chrome 识别为搜索引擎
如果我开始在 Chrome 中输入 stackov..,我可以看到类似于“按 Tab 进行搜索”的内容 stackoverflow.com'。
SO基本上被认为是一个搜索引擎。
您知道如何实现相同类型的
我认为它应该与OpenSearch有关,
<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="http://sstatic.net/so/opensearch.xml">
谢谢
编辑:
我认为它应该是只需指定以这种方式定义的 xml 即可(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>
,这是将要使用的URL。
http://stackoverflow.com/search?q={searchTerms}
searchTerms 将填充您在 chrome 中输入的字符串
If I start 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,您走在正确的轨道上。这是您正在寻找的 OpenSearch。他们有一些操作指南以及关于如何在您自己的网站上实现这一点的教程。
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.