将 URL 参数添加到 Firefox 的 DuckDuckGo 搜索插件
以下是对 DuckDuckGo 进行基本 https 查询的 xml 文件:
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Duck Duck Go (SSL)</os:ShortName>
<os:Description>Search Duck Duck Go (SSL)</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,[*redacted image code*]</os:Image>
<os:Url type="text/html" method="GET" template="https://duckduckgo.com/?q={searchTerms}">
</os:Url>
</SearchPlugin>
我想要某些参数(即 kb=-1 和 kg=p (链接)) 附加到通过 Firefox 搜索框执行的搜索。我尝试使用“”添加它,但这不起作用。
另外,虽然添加 kg=p 将使用 POST (而不是 GET)发出所有后续请求,但我如何使第一个请求成为 POST 请求。我尝试将 method="GET" 更改为 "POST",但这不起作用。
Here is the xml file for a basic https query to DuckDuckGo:
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Duck Duck Go (SSL)</os:ShortName>
<os:Description>Search Duck Duck Go (SSL)</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,[*redacted image code*]</os:Image>
<os:Url type="text/html" method="GET" template="https://duckduckgo.com/?q={searchTerms}">
</os:Url>
</SearchPlugin>
I want to have certain parameters (namely, kb=-1 and kg=p (link)) append to a search that's performed through Firefox's search box. I've tried adding it using "<Param name="paramName1" value="paramValue1"/>
" but that doesn't work.
Also, although adding kg=p will make all subsequent requests using POST (rather than GET), how can I make the initial one a POST request. I tried changing method="GET" to "POST", but that doesn't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用:
对所有出现的
&
使用&
来分隔参数,并对其他字符进行 URL 编码。You can use:
Use
&
for all occurrences of&
that would separate parameters, and URL-encode other characters.我在最新版本的firefox中找到了一种方法:
Windows 10 和 Windows 10 Firefox 40.0.3
最终删除
C:\Users\"¤¤"\Appdata\Roaming\Mozilla\Firefox\Profiles\"¤¤"\search.json
(如果这样做,您必须重新启动并再次关闭 Firefox,然后继续重新创建干净的 search.json)编辑文件
search.json
https://duckduckgo.com/
”(对我来说位于文件末尾)替换
https://duckduckgo。 com/
通过您自己的 URL 参数,如下所示:https://duckduckgo.com/?kae=d&kak=-1&kf=fw
在参数末尾添加字符“
&
”,如下所示:https://duckduckgo.com/?kae=d&kak=-1&kf=fw&
I find a way in the latest version of firefox :
Windows 10 & Firefox 40.0.3
Eventually delete
C:\Users\"¤¤"\Appdata\Roaming\Mozilla\Firefox\Profiles\"¤¤"\search.json
(if you do this you have to restart and close again firefox before continue to recreate a clean search.json)Edit the file
search.json
https://duckduckgo.com/
" (for me at the End Of File)Replace
https://duckduckgo.com/
by your own URL parameters like this :https://duckduckgo.com/?kae=d&kak=-1&kf=fw
add the char "
&
" at then end of parameters like this :https://duckduckgo.com/?kae=d&kak=-1&kf=fw&
我不知道从什么时候开始,但如果你想这样做,解决方案包括编辑文件
search.json
。您可以在 Firefox 的个人资料文件夹
中找到此文件。在此文件中,查找以下内容:
找到它后,通过编辑(第一个)模板来添加参数,如下所示:
在本示例中,我添加了
km=m
。这个参数km
改变了结果的处理方式。原来位于左侧,现在将位于居中。另外,不要忘记在您想要的每个参数之间添加&
。完成后,保存文件
search.json
并重新启动 Firefox。这适用于 Firefox 29 版本。
I didn't know since when but if you want to do this, the solution consist to edit the file
search.json
. You will find this one in yourprofile folder
of Firefox.Inside this file, look for this :
Once you have find it, add your parameters by editing the (first one) template like that :
In this example, I have add
km=m
. This parameterkm
change the disposal of the result. Instead to be on the left, now there will be centered. Also, don't forget to add&
between each parameters your want.Once you have done, save the file
search.json
and reboot Firefox.This work fine with the version 29 of Firefox.