如果我在Chrome中将搜索引擎更改为自定义搜索引擎,即使我启用了Use a prediction service to help complete searches and URLs typed in the address bar or the app launcher search box,chrome URL预测服务也会完全停止。它只适用于默认的搜索引擎,如谷歌,必应,雅虎。我怎样才能使它与我的自定义搜索引擎一起工作?
发布于 2016-02-26 02:24:32
终于找到了答案(感谢Labnol)。Chrome和其他新浏览器都在使用开放搜索标准,搜索引擎可以使用该标准为Web浏览器提供更多详细信息。
要添加新的搜索引擎,请将此代码添加到您的网页上。
<a href="javascript:onClick=window.external.AddSearchProvider('search.xml');" target="_self">Add Custom Search</a>在search.xml中,添加以下内容:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
<ShortName>SE</ShortName>
<Description>Search using SE</Description>
<InputEncoding>UTF-8</InputEncoding>
<Url type="application/x-suggestions+json" method="GET" template="https://www.google.com/complete/search?client=chrome-omni&gs_ri=chrome-ext-ansg&xssi=t&q={searchTerms}"/>
<Url type="text/html" method="GET" template="http://localhost/search?q={searchTerms}"/>
<SearchForm>http://localhost/</SearchForm>
</OpenSearchDescription>有关该标准的详细信息,请参阅this。
https://stackoverflow.com/questions/35582587
复制相似问题