2011-09-12 54 views
6

thể trùng lặp:
How to add google chrome omnibox-search support for your site?enable nhấn tab để tìm kiếm trong google chrome trên trang web của tôi

Tôi có một câu hỏi về làm thế nào để kích hoạt "tab báo chí để tìm kiếm" tính năng trong google chrome cho trang web của riêng tôi.

tôi đã được liên kết một tài liệu opensearch.xml và tôi có những điều sau đây bao gồm:

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

Tuy nhiên công việc vẫn doesnt này. Tôi có làm điều gì sai?

Cảm ơn!

Trả lời

7

Đây là opensearch.xml ví dụ mà làm việc cho tôi:

<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> 

Tôi nghĩ localhost và/hoặc phi tiêu chuẩn cổng 3000 cũng có thể đóng góp cho vấn đề.

+0

làm thế nào để bạn tìm thấy url dẫn trực tiếp đến hộp câu hỏi trên trang đích? (ví dụ: trong google translate) – JinSnow

Các vấn đề liên quan