7

可能重复:
如何为您的网站添加 google chrome 多功能框搜索支持?

我有一个关于如何为我自己的网站启用谷歌浏览器中的“按标签搜索”功能的问题。

我已经链接了一个 opensearch.xml 文档,其中包括以下内容:

<Url type="text/html" template="http://localhost:3000/?search={searchTerms}"/>

但是,这仍然不起作用。难道我做错了什么?

谢谢!

4

1 回答 1

7

这是opensearch.xml对我有用的示例:

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>Example.com</ShortName>
    <LongName>Example.com Search</LongName>
    <Description>Search through Example.com</Description>
    <Query role="example" searchTerms="example search"/>
    <InputEncoding>UTF-8</InputEncoding>
    <OutputEncoding>UTF-8</OutputEncoding>
    <AdultContent>false</AdultContent>
    <Language>en-us</Language>
    <SyndicationRight>open</SyndicationRight>
    <Developer>Example.com</Developer>
    <Tags>tag1,tag2</Tags>
    <Image height="16" width="16" type="image/vnd.microsoft.icon">http://example.com/favicon.ico</Image>
    <Url type="text/html" template="http://example.com/search.html?q={searchTerms}"/>
    <Url type="application/x-suggestions+json" template="http://example.com/suggestions.html?query={searchTerms}"/>
</OpenSearchDescription>

我认为localhost和/或非标准端口3000也可能导致问题。

于 2011-09-12T15:53:40.657 回答