gpt4 book ai didi

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

转载 作者:搜寻专家 更新时间:2023-10-31 22:33:21 25 4
gpt4 key购买 nike

我在 duckduckgo,想在我的浏览器中添加搜索引擎字段,

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

enter image description here

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

请注意:

我(现在)不打算实现自动建议功能,我只是想将服务保存在浏览器中(与 stackoverflow+firefox 的行为完全相同)

-编辑-

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

1)

    <link title="your service name" type="application/opensearchdescription + xml " rel="
search " href="/opensearch.xml ">

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>

但是对于我的域名和 URL,firefox 没有检测到该服务(与图片中的方式相同),我错过了什么?

最佳答案

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

基本上,您将在您的站点上提供一个类似于以下内容的 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>

...并在 <head> 中链接到它您的网站像这样:

<link rel="search" 
type="application/opensearchdescription+xml"
href="http://www.example.com/search.src"
title="Add Example.Com Search" />

this lifehacker.com article中的评论(您需要选择“全部”才能看到评论)似乎通过引用 Facebook 的实现来解决如何在您自己的网站上实现它。环顾四周,好像quite a few major reference sites implement this functionality .

关于html - 建议用户在站点时将搜索引擎添加到 firefox,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10302629/

25 4 0
文章推荐: node.js - 用于连接到 Postgresql 数据库的 AWS Lambda 函数
文章推荐: node.js - Multer上传不是一个功能
文章推荐: node.js - 获取满足查询条件的文档 ID
文章推荐: javascript - 我正在制作浏览器内的单色 LED 显示屏。我应该使用 还是
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com