2

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.

4

3 回答 3

2

您可以使用:

<os:Url type="text/html" method="GET" template="https://duckduckgo.com/?paramName1=paramValue1&amp;q={searchTerms}">

用于&amp;所有出现的&分隔参数,并对其他字符进行 URL 编码。

于 2011-11-09T08:50:23.823 回答
1

我在最新版本的 Firefox 中找到了方法:Windows 10 & Firefox 40.0.3

  • 关闭 Firefox 的所有会话。
  • 最终删除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&

  • 保存存档
  • 重启火狐
于 2015-09-16T03:53:39.180 回答
0

我不知道从什么时候开始,但如果你想这样做,解决方案包括编辑文件search.jsonprofile folder你会在你的 Firefox中找到这个。

在这个文件中,寻找这个:

"_urls":
    [{
        "template": "https://duckduckgo.com/?q={searchTerms}",
        "rels": [],
        "params": []
    },
    {
        "template": "https://ac.duckduckgo.com/ac/?q={searchTerms}&type=list",
        "rels": [],
        "type": "application/x-suggestions+json",
        "params": []
    }],

找到它后,通过编辑(第一个)模板来添加参数:

"_urls":
    [{
        "template": "https://duckduckgo.com/?km=m&q={searchTerms}",
        "rels": [],
        "params": []
    },

在这个例子中,我添加了km=m. 这个参数km改变结果的处理。而不是在左边,现在将居中。另外,不要忘记在您想要的每个参数&之间添加。完成后,保存文件并重新启动 Firefox。search.json

这适用于 Firefox 29 版。

于 2014-05-21T10:34:33.453 回答