2010-12-11 31 views
2

這是一個基本的HTTPS查詢XML文件DuckDuckGo:添加網址參數的DuckDuckGo searchplugin爲Firefox

<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公斤= P( link))附加到通過Firefox的搜索框執行的搜索。我嘗試使用「<Param name="paramName1" value="paramValue1"/>」添加它,但這不起作用。

此外,雖然添加kg = p將使所有後續請求使用POST(而不是GET),但我怎樣才能使最初的一個POST請求。我試着將method =「GET」更改爲「POST」,但這不起作用。

回答

2

您可以使用:

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

使用&amp;&所有出現,將分隔參數和URL編碼,其它字符。

0

我不知道從什麼時候開始,但如果你想這樣做,解決方案包括編輯文件search.json。您會在Firefox的profile folder中找到這個。

在這個文件中,查找本:

"_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更改結果的處置。而不是在左邊,現在會有中心。另外,請不要忘記在each parameters之間加&。 完成後,保存文件search.json並重新啓動Firefox。

這與Firefox的29版本很好。

1

我發現在Firefox的最新版本的方法: 的Windows 10 &火狐40.0.3

  • 關閉Firefox的所有會議。
  • 最終刪除C:\Users\"¤¤"\Appdata\Roaming\Mozilla\Firefox\Profiles\"¤¤"\search.json(如果你這樣做,你必須重新啓動,並再次火狐之前關閉繼續重新建立一個乾淨的search.json)

  • 編輯文件search.json

  • 查找「https://duckduckgo.com/」(對我來說在文件的結束)
  • 像這樣通過自己的URL參數替換https://duckduckgo.com/https://duckduckgo.com/?kae=d&kak=-1&kf=fw

  • 添加炭「&」 在然後結束的參數是這樣的:https://duckduckgo.com/?kae=d&kak=-1&kf=fw&

  • 保存文件
  • 重新啓動Firefox