1

我想制作一个带有包含搜索关键字的 get 参数的页面。当我进入一个网站时,firefox 会识别出具有搜索功能的适当网站,并允许您单击几下即可添加它们。(地址栏上的下拉菜单) 我的网站如何告诉firefox 或chrome 它具有每个人都可以从浏览器地址栏或chrome 的omnibar 使用的搜索功能?

4

1 回答 1

3

你需要这个元标记

 <link rel="search" type="application/opensearchdescription+xml" href="[your url]/opensearch.xml" title="[Your title]" /> 

您可以在此处找到更多信息http://www.opensearch.org/Home

你的 xml 文件看起来像

<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
    <ShortName>[Name]</ShortName>
    <Description>[Desc]</Description>
    <Image height="16" width="16" type="image/x-icon">[ico]</Image>
    <Image height="64" width="64" type="image/png">[png]</Image>
    <Url type="text/html" method="get" template="[url]/?q={searchTerms}"/>
    <Url type="application/opensearchdescription+xml" rel="self" template="[url]/opensearch.xml"/>
</OpenSearchDescription>
于 2012-09-24T14:46:13.110 回答