【问题标题】:Opensearch - Changing the name of search engineOpensearch - 更改搜索引擎的名称
【发布时间】:2019-01-08 00:57:33
【问题描述】:

我一直在尝试将 opensearch 支持添加到我的网站。这就是我所拥有的 opensearch.xml 文件:

   <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
  <script/>
  <ShortName>Host</ShortName>
  <Description>Search my Website</Description>
  <InputEncoding>UTF-8</InputEncoding>
  <Image width="16" height="16" type="image/x-icon">Favicon url</Image>
  <Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&amp;q={searchTerms}" />
  <Url type="text/html" method="GET" template="http://yoursite.com/?s={searchTerms}" />
  <SearchForm>http://yoursite.com/</SearchForm>
</OpenSearchDescription>

但它会将 URL 名称注册为 Chrome 设置中的搜索引擎名称以及按标签建议。我可以更改什么来识别具有不同名称的搜索引擎?

【问题讨论】:

标签: google-chrome opensearch


【解决方案1】:

首先,那个脚本标签不应该在那里,所以你应该有这样的东西:

 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
  <ShortName>Host</ShortName>
  <Description>Search my Website</Description>
  <InputEncoding>UTF-8</InputEncoding>
  <Image width="16" height="16" type="image/x-icon">Favicon url</Image>
  <Url type="application/x-suggestions+json" method="GET" template="http://suggestqueries.google.com/complete/search?output=firefox&amp;q={searchTerms}" />
  <Url type="text/html" method="GET" template="http://yoursite.com/?s={searchTerms}" />
  <SearchForm>http://yoursite.com/</SearchForm>
</OpenSearchDescription>

那么,您是否尝试过更改页面中包含的链接元素的名称?

<link rel="search" href="/opensearchdescription.xml" type="application/opensearchdescription+xml" title="name" />

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-01-15
    • 1970-01-01
    • 1970-01-01
    • 2012-01-29
    • 1970-01-01
    • 1970-01-01
    • 2014-04-29
    • 2014-04-28
    相关资源
    最近更新 更多