如果我开始在 Chrome 中输入 stackov..,我会看到类似'Press Tab to search stackoverflow.com' 的内容。
SO基本上被认为是搜索引擎。
您知道如何在我们的 WebApp中实现相同的功能吗?
我认为它应该与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 中输入的字符串填充