为IE Search Provider启用网页

时间:2009-11-16 06:04:10

标签: internet-explorer search-engine

当我们访问Stack Overflow时,IE即时搜索下拉按钮变为橙色,表示可以添加SO作为搜索提供商。

我应该在IE网页中放入哪些代码才能检测到它是兼容的搜索网页?

谢谢!

2 个答案:

答案 0 :(得分:0)

直接从SO来源采取的示例:

<link rel="search" type="application/opensearchdescription+xml" title="Stack Overflow" href="http://sstatic.net/so/opensearch.xml">

在此处阅读更多内容:http://www.opensearch.org/

答案 1 :(得分:0)

您只需创建一个 OpenSearch描述文档,然后在HTML标题中包含指向它的链接。

OpenSearch doco页面显示了说明文档

的示例
<?xml version="1.0" encoding="UTF-8"?>
 <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
   <ShortName>Web Search</ShortName>
   <Description>Use Example.com to search the Web.</Description>
   <Tags>example web</Tags>
   <Contact>admin@example.com</Contact>
   <Url type="application/rss+xml" 
    template="http://example.com/?q={searchTerms}&amp;pw={startPage?}&amp;format=rss"/>
 </OpenSearchDescription>

然后在HTML标题中添加以下内容:

<link rel="search"
       type="application/opensearchdescription+xml" 
       href="http://example.com/content-search.xml"
       title="Content search" />