Add URL Parameters to the DuckDuckGo searchplugin for Firefox

user384862 picture user384862 · Dec 11, 2010 · Viewed 7.2k times · Source

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.

Answer

Benoit picture Benoit · Nov 9, 2011

You can use:

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

Use &amp; for all occurrences of & that would separate parameters, and URL-encode other characters.