当用户在站点时建议将搜索引擎添加到firefox

Ton*_*bet 3 html url firefox search-engine

我在duckduckgo,并希望将搜索引擎字段添加到我的浏览器,

通常你必须在浏览器实用程序中搜索,但当我看到浏览器已经检测到它时,我感到很惊讶.

在此输入图像描述

如何让我的网站搜索自动显示?

请注意:

我不是在寻找(现在)实现自动建议功能,我只是试图将服务保存在浏览器中(与stackoverflow + firefox完全相同)

-编辑-

试过我在他们网站上找到的代码,与opensearch文档匹配:

1)

    <link title="your service name" type="application/opensearchdescription + xml " rel="
search " href="/opensearch.xml ">
Run Code Online (Sandbox Code Playgroud)

2)xml文件:/opensearch.xml

<OpenSearchDescription>
     <ShortName>DuckDuckGo</ShortName>
     <Description>Search DuckDuckGo (SSL)</Description>
     <InputEncoding>UTF-8</InputEncoding>
     <LongName>DuckDuckGo Search (SSL)</LongName>
     <Image width="16" height="16">http://duckduckgo.com/favicon.ico</Image>
     <Url type="text/html" method="get" template="https://duckduckgo.com/?q={searchTerms}"/>
</OpenSearchDescription>
Run Code Online (Sandbox Code Playgroud)

但是使用我的域名和URL,并且firefox没有检测到服务(与图片中的方式相同),我缺少什么?

Rod*_*ine 5

显然,Firefox,IE和Chrome能够检测实现OpenSearch标准的网站.

基本上,您将在您的站点上提供类似于以下内容的XML OpenSearch描述文档:

<?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>
Run Code Online (Sandbox Code Playgroud)

...并在<head>您的网站链接到它,如下所示:

<link rel="search" 
  type="application/opensearchdescription+xml" 
  href="http://www.example.com/search.src" 
  title="Add Example.Com Search" />
Run Code Online (Sandbox Code Playgroud)

这篇lifehacker.com文章中的评论(您需要选择"全部"来查看评论)似乎解决了如何在您自己的网站上实现它以及Facebook的实现.环顾四周,似乎有不少主要参考站点实现此功能.