Chrome通常通过用户首选项来处理此问题。(通过
chrome://settings/searchEngines)
但是,如果您想专门为您的用户实施此操作,则需要向您的站点添加OSD(打开搜索描述)。
是否在个人网站上使用Google Chrome的OmniBoxTAB]功能?
然后,您将此XML文件添加到网站的根目录,并在您的
<head>标记中链接到该文件:
<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="/opensearch.xml" />
现在,您网页的访问者将自动在的Chrome内部设置中放置您网站的搜索信息
chrome://settings/searchEngines。
OpenSearchDescription XML格式示例
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/"><ShortName>Your website name (shorter = better)</ShortName><Description>Description about your website search here</Description><InputEncoding>UTF-8</InputEncoding><Image width="16" height="16" type="image/x-icon">your site favicon</Image><Url type="text/html" method="get" template="http://www.yoursite.com/search/?query={searchTerms}"/></OpenSearchDescription>重要的部分是
<url>项目。
{searchTerms}将被用户在多功能栏中搜索的内容替换。这是OpenSearch的链接,以获取更多信息。



