0
我想用包含搜索关键字的get参数制作页面。当我进入一个网站时,Firefox会识别具有搜索功能的适当网站,并允许您通过点击几下鼠标来添加它们。 (地址栏上的下拉菜单)我的网站如何告诉firefox或chrome它有一个搜索功能,每个人都可以在浏览器地址栏或全屏浏览器中使用?网站如何告诉浏览器它是一个可以作为搜索引擎添加的搜索引擎?
我想用包含搜索关键字的get参数制作页面。当我进入一个网站时,Firefox会识别具有搜索功能的适当网站,并允许您通过点击几下鼠标来添加它们。 (地址栏上的下拉菜单)我的网站如何告诉firefox或chrome它有一个搜索功能,每个人都可以在浏览器地址栏或全屏浏览器中使用?网站如何告诉浏览器它是一个可以作为搜索引擎添加的搜索引擎?
你需要这个元标记
<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>
它希望像“页面的输出作为HTML“或”XML数据“? –
它会使用你的普通html页面。 ''url =“text/html”method =“get”template =“[url] /?q = {searchTerms}”/>'应该指向您的常规搜索页面,只需替换为{{searchTerms}查询通常会去 –