7

重複の可能性:
あなたのサイトにグーグルクロームオムニボックス検索サポートを追加する方法は?

自分のウェブサイトでグーグルクロームの「タブを押して検索」機能を有効にする方法について質問があります。

私はすでに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 に答える