11

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.

1 Answer 1

4

This is off-topic, 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.

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 here

  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

  1. 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.

Source

2
  • 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, 2013 at 22:53
  • Seems for now v86.0 x64 only support mycroft project. It's sad. Mar 1, 2021 at 13:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .