Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Recently I decided to use duckduckgo instead of google, and I installed it as a search engine.

The problem is that Firefox uses https://duckduckgo.com/opensearch.xml to know the search url. But I want to customize it using parameters.

Then, I tried going to Firefox's profile folder and modifying search.json and searchplugins/duckduckgo.xml with my own parameters.

It worked at first, but I have Firefox Nightly (updated each day), and after each update I lose my list of search engines.

To recover it, I do:

  1. Delete search.json and searchplugins/duckduckgo.xml
  2. Restart firefox
  3. Add duckduckgo again
  4. Modify search.json and searchplugins/duckduckgo.xml again

But I don't want to do that everyday. Which is the correct way of customizing search engines?


Note 1: The difference between an old search.json and a new one is minimal:

1.

  • {"version":7,"buildID":"20131109030206","locale":"en-US","directories":{"Path\\To\\Nightly\\browser\\searchplugins":{"lastModifiedTime":1384018305984,"engines":

  • {"version":7,"buildID":"20131110030205","locale":"en-US","directories":{"Path\\To\\Nightly\\browser\\searchplugins":{"lastModifiedTime":1384100021250,"engines":

2.

  • "Path\\To\\Profile\\searchplugins":{"lastModifiedTime":1384040082109,"engines":[{"_id":"[profile]/duckduckgo.xml"

  • "Path\\To\\Profile\\searchplugins":{"lastModifiedTime":1384100281656,"engines":[{"_id":"[profile]/duckduckgo.xml"

3.

  • "_urls":[{"template":"https://duckduckgo.com/?q={searchTerms}&myCustomParameter=myCustomValue"

  • "_urls":[{"template":"https://duckduckgo.com/?q={searchTerms}"

Note 2:

I know I can use URL keywords and modify keyword.URL, but I want to be able to search with my customized search engine using the search bar too.

Then, my question is not a duplicate of How to add a custom search engine to Firefox?.


Solution

It seems the problem was that adding DuckDuckGo using Firefox.

Firefox created the following DuckDuckGo.xml:

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>DuckDuckGo</os:ShortName>
<os:Description>Search DuckDuckGo (SSL)</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,...</os:Image>
<os:Url type="text/html" method="GET" template="https://duckduckgo.com/?q={searchTerms}">
</os:Url>
</SearchPlugin>

But it should be

<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
    <ShortName>DuckDuckGo</ShortName>
    <Description>DuckDuckGo. More Privacy. Less Spam.</Description>
    <InputEncoding>UTF-8</InputEncoding>
    <Image height="16" width="16" type="image/x-icon">data:image/x-icon;base64,...</Image>
    <Url type="text/html" method="GET" template="https://duckduckgo.com/">
        <Param name="q" value="{searchTerms}"/>
    </Url>
    <SearchForm>https://duckduckgo.com/</SearchForm>
</SearchPlugin>

Not sure if I changed things in search.json too.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

this is offtopic, but thanks for the anonymous search engine duckduckgo

You can use this opensearch Mycroft Project

It has everything already created just enter the values into textbox and and you have the XML code.

You can also submit your website search engine here at http://mycroftproject.com/submitos.html

or 

Here are the steps: 1) Need to create an xml file which will contain information about search engine like ShortName, Description, Url etc. Example of xml file: https://developer.mozilla.org/en/Creating_MozSearch_plugins

2) Give a name to that xml file and put it here:

"%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\searchplugins"

or here:

"%PROGRAM_FILES%\Mozilla Firefox\searchplugins"

3) Modifying firefox preferences file:

"%APPDATA%\Mozilla\Firefox\Profiles\XXXXXXXX.default\prefs.js"

Simply add/modify this line:

user_pref("browser.search.selectedEngine", "engine_name");

No needing to modify sqlite database file manually. New search engine will be added automatically after restarting firefox.

http://www.wikihow.com/Add-a-Custom-Search-Engine-to-Firefox%27s-Search-Bar-%28Windows-Version%29

share|improve this answer
    
Using the xml example from MDN fixed the problem. It seems Firefox doesn't know how to create search plugins for itself... –  Oriol Nov 16 '13 at 22:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.