Tutorial

Firefox Search Engine Cautions and Recommendations

Last updated: 17-Sep-2017 (see the change log at bottom)

Firefox search engine plugins and your privacy

One of the primary ways the Mozilla Foundation generates revenue is to partner with search engine companies, including Yahoo, Google and others. This creates a problem for those that value their privacy and right to remain anonymous in that Firefox collects data about your searches and sends extra information about the browser to Mozilla and to these 3rd parties every time you use any of the default search engine plugins that are packaged with the browser. The result is that it becomes easier for both Mozilla and their partners to fingerprint your browser and track your web activities. The scope of this tutorial is limited primarily to restoring your privacy regarding the use of search engine plugins and finding alternative ways to use the big search indexes, such as Google, Bing and Yahoo, as well as discover new search engines. For a much more in-depth tutorial regarding Firefox privacy issues and customization, please see my article, Firefox Configuration Guide for Privacy Freaks and Performance Buffs.

Types of search engines

It appears there are basically two types of search engines; meta search engines and search indexes and it is important to understand the difference. Google, Yahoo and Bing for example, use software robots known as “crawlers” to index web content. In other words these companies actively seek out updated and fresh content to store in their databases so that it’s ready for you to find. Meta search engines, on the other hand, typically do not index the web and instead rely primarily on third parties to provide their search results, including Google, Yahoo and Bing. As such, even when using a so-called “alternative” search engine such as DuckDuckGo, Startpage, Searx, etc., you are still subject to at least a portion of the content manipulation and censorship employed by the big corporations which deliver their results to your chosen alternative. While these alternative search engines do indeed make a great deal of sense from a privacy perspective since one can avoid using the big indexes directly, they are not true alternatives as they are often described, but more like search engine proxies which simply provide their own interface to display the search results as provided by the big boys.

Indexing the web can be an incredibly expensive proposition and this is why centralized companies like DuckDuckGo, Startpage, Searx and others rely on search results provided by corporations like Google. There is an even better solution however, one which both respects your privacy and is censorship resistant and these are distributed search indexes. Imagine a free, open-source search engine that is completely decentralized where the search index is distributed among millions of computers like yours, each storing a piece of the whole. There are probably no for-profit corporations involved, no office headquarters and no board of directors. This is what the developers behind YaCy have done with their peer-to-peer search engine and i think it’s a great way to move forward and away from corporate censorship.

Adding search engines to Firefox

Possibly the easiest way to mitigate risks to your anonymity posed by using the default Firefox search engines is to simply disable all of them and find alternatives. One of my favorite choices is the open source and highly configurable Searx meta search engine which you can host an instance of on your own server if you wish, but you don’t have to in order to use it. Searx, like DuckDuckGo, Startpage and many others, is not an index and so it does not crawl the web seeking out and storing content like Google and the others do. Like most of the alternative search engines, Searx is a meta search engine meaning that it pulls its search results from third party indexes. The difference between Searx and many of the other meta search engines, is that Searx is capable of pulling results from many other indexes and meta search engines, any of which you can enable or disable.

An easy way to add Searx to Firefox is to simply find a hosted instance which you like, preferably one close to you, and from the Firefox search bar, click “add”. While searx.me is the original instance of Searx, it is best not to use it because it can become overloaded. The developers may even disable it at times in order to promote the many other third party instances. This is done because it is very expensive to run a search engine and searx.me cannot afford to have too many people using their instance without donations from folks like us. A potential pitfall to using a 3rd party instance of Searx is that the server may be logging information, such as IP addresses, etc., so you’ll have to decide what’s best for you.

You can add most other search engines to Firefox using the same process as described above, but there are other ways also. The Mycroft Project hosts tens of thousands of preconfigured search engine plugins for a variety of web browsers and has a form for writing your own plugins. These plugins can be added to Firefox simply by clicking on their names, the top 100 of which are listed here. Unfortunately it is not possible to review the code from the main search plugins listing before adding the plugin to your browser, however you can use their submission form to do so by mousing over the plugin name to reveal its numeric ID and then filling in that ID in the submission form page.

Privacy-centric search engines

Following is a table of some of the more popular search engines which are focused more toward maintaining your privacy.

Legend:

  • Decentralized – whether the service and index are controlled by a single entity, such as Google
  • Type – meta (uses a 3rd party to obtain results), index (crawls the web and doesn’t rely on a 3rd party) or hybrid (a combination of meta and index technologies)
  • Requires JS / Cookies – whether the web interface requires JavaScript and/or cookies (web storage)
  • Client Required – whether you have to download client software in order to use their service
Name Decentralized Type Requires JS / Cookies Client Required Privacy Policy Comments
Disconnect

search page (SSL)

no meta no, but functionality is limited / no, but settings are not saved no privacy policy Disconnect apparently pulls results from Yahoo, Bing and DuckDuckGo, though in my case it forwards all searches to DuckDuckGo regardless of what the preferred search engine is set to. Personally i see no advantage to using Disconnect over other meta search engines.
DuckDuckGo

search page (SSL)

no hybrid yes(?) if searching from the FF search bar, no if searching from the web page / no, but settings are not saved no privacy policy DuckDuckGo claims to pull its search results from over 400 sources including Wikipedia, Bing, Yahoo and Yandex, as well as its own crawler, and its interface is similar to Google. The company generates revenue from ads which can be disabled in the settings. DuckDuckGo also offers a ‘lite’ version which does not use JS or cookies.
FAROO

search page (No SSL)

no index yes / no optional ? FAROO offers a distributed, censorship resistant, peer-to-peer search engine and index, however it is powered by proprietary client software. In answering the question “Why you don’t publish your product as Open Source?“, their response is “[…] it’s not a good idea to hand over your technological advantage to a monopoly, when competing with its free service with enormous brand power.“. A very poor answer in my personal opinion.
Hulbee

search page (SSL)

no meta? yes / no, but settings are not saved no privacy policy Hulbee has a solid privacy policy and an interesting interface, however it appears they pull their results from Bing, though i don’t know if they use Bing exclusively.
MetaGer

search page (SSL)

no hybrid? no, but some functionality loss / no, but settings are not saved no privacy policy MetaGer, which has been around for a couple decades, has an excellent privacy policy and claims to pull results from up to 50 other search engines.
Peekier

(search page)

no meta yes / no, but settings are not saved no privacy policy Peekier provides an interesting, though feature limited interface in the form of zoomable text and thumbnail images of the web pages corresponding to your search results, thus allowing you browse the results before visiting the source page. Peekier appears to pull its results from Bing only however, which is unfortunate.
Searx

(search page)

partially meta yes(?) if searching from the FF search bar, no if searching from the web page / no, but settings are not saved no n/a Searx is a meta search engine which i have found to be the best of its type because of its capability to pull results from a wide array of third party services and it is highly configurable. The interface is clean, customizable, intuitive and similar to Google except it is a bit more powerful. Anyone can run a Searx instance on their own server (see their GitHub page).
Startpage/Ixquick

(search page)

no meta no, but some functionality loss / no, but settings are not saved no privacy policy Startpage/Ixquick apparently pulls its search results from the top 10 results of other major indexes, such as Google. They have a strong privacy policy and an extensive Q&A page regarding privacy, however they do use tracking images, so if you are using uBlock Origin, go here for the filters necessary to block them.
YaCy

(search page)

yes index yes / no optional n/a YaCy is, in my opinion, the most interesting search engine listed here in that it is a decentralized, distributed, censorship resistant search engine and index powered by free, open-source software. At this time YaCy doesn’t produce a lot of pertinent search results, however the more people use it, the better it will become. For those wanting to run your own instance of YaCy, see their home page and their GitHub page. This article from Digital Ocean may also be of help if you want to run YaCy on a VPS.
Name Decentralized Type Requires JS / Cookies Client Required Privacy Policy Comments

Sanitizing the default search engine plugins

If you choose to use the default search engine plugins provided by Mozilla, you may want to sanitize them in order to circumvent some of the risks to your privacy, however you should be aware that sanitizing the default plugins will not prevent tracking or privacy risks at the search engine level when using the services provided by Google, Bing, Yahoo, etc.. If you are going to use the default search engine plugins, then you should also use something like the Neat URL add-on which strips tracking parameters from URLs.

If you want to sanitize the default search engine plugins yourself you might want to install the XML Search Engines Exporter/Importer (legacy add-on that won’t work for Firefox v57+) Firefox add-on which makes it super-easy to export and import the modified plugin code wherein we will remove the monetization schemes and browser fingerprinting which Mozilla employs. Unfortunately, using the XML Search Engines Exporter/Importer add-on is the only reasonable way i am aware of to extract the data from the search.json.mozlz4 file where the search engine code is stored, so that it can be edited. This will require a bit of time but is not difficult to accomplish. You will also want a decent code editor, such as Kate for Linux (already included in some distributions) or something like Notepad++ or PSPad for Windows. Another alternative if you do not want to sanitize the default search engine plugins manually, is to simply download my pre-sanitized search engine plugins below.

By default, at the time of this writing, Firefox includes the following search plugins:

  • Amazon
  • Bing
  • DuckDuckGo
  • Google
  • Twitter
  • Wikipedia
  • Yahoo

Sanitizing the search plugins manually

After installing XML Search Engines Exporter/Importer, open the Firefox preferences UI and navigate to the “Search” tab (or enter about:preferences#search in the address bar). You should probably make sure that all of the search engines are enabled at this point, even those you don’t use, else you will not be able to edit them. Click the “Restore Default Search Engines” button if necessary. Near the bottom of the search preferences UI you will notice some new buttons, but the one we are interested in is labeled “Export All Search Engines to File…”. This will export all of the default search engine plugins, as well as any others you may have added, to a ZIP archive, the extraction of which will reveal a bunch of XML files and it is these which we will be editing.

The following uses the yahoo.xml file as an example. Note that the base64 image code for the Yahoo icon was removed to shorten it:

<?xml version="1.0" encoding="UTF-8"?>
<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/" xmlns:os="http://a9.com/-/spec/opensearch/1.1/">
<os:ShortName>Yahoo</os:ShortName>
<os:Description>Yahoo Search</os:Description>
<os:InputEncoding>UTF-8</os:InputEncoding>
<os:Image width="16" height="16">data:image/x-icon;base64,[icon code removed]</os:Image>
<SearchForm>https://search.yahoo.com/yhs/search?p=&amp;ei=UTF-8&amp;hspart=mozilla&amp;hsimp=yhs-001</SearchForm>
<os:Url type="application/x-suggestions+json" method="GET" template="https://search.yahoo.com/sugg/ff" resultDomain="search.yahoo.com">
 <os:Param name="output" value="fxjson"/>
 <os:Param name="appid" value="ffd"/>
 <os:Param name="command" value="{searchTerms}"/>
</os:Url>
<os:Url type="text/html" method="GET" template="https://search.yahoo.com/yhs/search" rel="searchform" resultDomain="yahoo.com">
 <os:Param name="p" value="{searchTerms}"/>
 <os:Param name="ei" value="UTF-8"/>
 <os:Param name="hspart" value="mozilla"/>
 <!--The original definition of this search engine included too some non-standard 'MozParam' parameters. As they are recognized by Firefox only if they are found in an engine included by default in the application, they were omitted here.-->
</os:Url>
</SearchPlugin>

Examining the above code reveals parameters which can be used to fingerprint and track our browser and are not necessary for performing a search with Yahoo. Following are the parameters which we want to edit:

In the <SearchForm> tag, everything after /search in the URL, beginning with the question mark, can be removed so we end up with the following:

<SearchForm>https://search.yahoo.com/yhs/search</SearchForm>

The entire block beginning with <os:Url type="application/x-suggestions+json" and ending with the first of the two </os:Url> closing tags can be removed. This will disable some fingerprinting as well as search suggestions.

The line <os:Param name="hspart" value="mozilla"/> can be removed.

The last thing you must to do is rename the search engine since the XML Search Engines Exporter/Importer add-on will not import a search engine plugin with the same name as a default plugin included with Firefox. This will also allow you to be sure you are using the sanitized version of Yahoo rather than the default one as provided by Mozilla since the modified name will be the one displayed in your search bar and in your search preferences. To rename the plugin, simply edit the following line and change Yahoo to whatever you wish:

<os:ShortName>Yahoo</os:ShortName>

I might suggest something like this, where the (s) stands for “sanitized”:

<os:ShortName>Yahoo (s)</os:ShortName>

The above is how the Yahoo search engine will be displayed in your search bar and in the Firefox preferences.

The name of the XML file does not have to be changed, but you may want to append something like _s to it to indicate it has been sanitized so you don’t get it mixed up with the default search plugin.

For the remaining search engine plugins you basically want to repeat what we have done above with Yahoo. The parameter names and values will sometimes differ from the examples above, but basically you want to look for anything that identifies your browser, operating system and, potentially, your local and remove it. For example, if you exported the Wikipedia search plugin XML file, you will find in it &amp;sourceid=Mozilla-search and <os:Param name="sourceid" value="Mozilla-search"/>, both of which can be removed. The exception with all of the search plugin XML files is that you do not need to alter the <SearchPlugin xmlns= line even though it may contain a mozilla.org URL.

To import the sanitized search engine files if you are using the XML Search Engines Exporter/Importer add-on:

  1. Start Firefox, open the search preferences UI (about:preferences#search) and import your sanitized search plugins. Optionally you may want to disable/remove the default search plugins.

To import the sanitized search engine files if you are not using the XML Search Engines Exporter/Importer add-on:

  1. Place your sanitized search plugin XML files in the /searchplugins folder within your Firefox profile folder (create the directory if need be).
  2. In your Firefox profile folder, rename the search.json.mozlz4 file to search.json.mozlz4.bak.
  3. Restart Firefox and, optionally, open the search settings in the preferences UI (about:preferences#search) and disable/remove the default search plugins.

Using my pre-sanitized search engine plugins

If you would rather avoid the hassle of sanitizing the default search plugins manually, you can simply use my pre-sanitized files below which include Amazon, Bing, DuckDuckGo, Google, Twitter, Wikipedia and Yahoo. Each will have an “(s)” appended to its name in your search bar and search preferences. Note that you should still sanitize the prefs.js preferences corresponding to these search plugins as described below.

In all cases the search suggestion code has been removed and _s was appended to the XML file names. In the case of Google it has been further customized to disable safe search, auto-complete, personalized search and other annoyances. Google has also been configured to use only google.com, thus disabling the automatic country redirect (in other words if you live in Canada and want to use google.com, Google will no longer redirect to google.ca) and both the displayed name and file name include “NCR” which stands for “No Country Redirect”.

Preform the following steps to install the sanitized search plugins:

  1. Download the sanitized_search_plugs.zip archive and extract it in the /searchplugins folder within your Firefox profile folder (create the directory if necessary).
  2. In your Firefox profile folder, rename the search.json.mozlz4 file to search.json.mozlz4.bak.
  3. Restart Firefox and, optionally, open the search settings in the preferences UI (about:preferences#search) and disable/remove the default search plugins.

Sanitizing the prefs.js search engine preferences

Another step we need to perform is to sanitize any browser.search.param. preferences in the prefs.js file. To do this it is best to create a custom user.js file to store our modified preferences if you don’t already have one. You can read the tutorial, Firefox Configuration Guide for Privacy Freaks and Performance Buffs, for information on creating the file, as well as many additional things we can do to protect our privacy and tighten the security of Firefox.

To sanitize the search engine preferences, open the about:config URL in your browser and enter browser.search.param. in the search field. At the time of this writing there are only two preferences that will be displayed and they are browser.search.param.yahoo-fr and browser.search.param.yahoo-fr-ja. The default values may be different in your case, but in mine they are data:text/plain,browser.search.param.yahoo-fr=linuxmint and an empty string, respectively. What you need to do is copy both preference names to your user.js file and set the values to an empty string:

user_pref("browser.search.param.yahoo-fr", ""); // sanitize Yahoo
user_pref("browser.search.param.yahoo-fr-ja", ""); // ^

If you are going to sanitize the other default search engine XML files, you may as well sanitize any other prefs.js preferences related to the other search engines as we did above. Simply enter browser.search.param. in the search field and copy all the preference names to your user.js file and set the empty the values as shown above (again, at the time of this writing, the only two preference names refer to Yahoo).

Removing the ‘Follow On Search’ system add-on

Mozilla packages some system add-ons (browser extensions) with Firefox and installs them without your permission. Also these system add-ons are not listed in the Extensions section of the Preferences UI (about:addons). The technology behind one of these system add-ons is called “Follow-on Search” (also see the Mozilla GitHub repository page) and it is used to collect data about the way you use the Google, Bing and Yahoo search engines. Note that this add-on works independently of the search engine plugins discussed in this article.

To see if the Follow-on Search add-on is installed, open about:support in the Firefox address bar and look under the section titled “Firefox Features”. In my particular case under Linux Mint, there was no “Firefox Features” section included on the support page, nor was the add-on found on my system, however there were other system add-ons found.

The Follow On Search add-on, which has the file name followonsearch@mozilla.com.xpi, is located at /usr/lib/firefox/browser/features on Linux Mint (and very likely other flavors of Linux as well) and at \Program Files (x86)\Firefox\browser\features or \Program Files\Firefox\browser\features on Windows and i would suggest either deleting or disabling it. Under Linux, i am not aware of how it can be disabled, but it can certainly be deleted:

cd /usr/lib/firefox/browser/features
sudo rm followonsearch@mozilla.com.xpi

Or if you want to delete all of the system add-ons:

cd /usr/lib/firefox/browser/features
sudo rm *.xpi

On Windows you can apparently use CCleaner to disable these system add-ons from the Tools > Browser Plugins menu.

Note that these system add-on files will be recreated when Firefox is updated and therefore you will need to delete/disable them after each update. On Windows, CCleaner may keep these add-ons disabled after a Firefox update but you should check to be sure. Since i use Linux, i just created a link to the /feature folder on my desktop to remind me to delete the add-ons (i’m sure there’s a much more elegant way to auto-remove them, but i’m a Linux noob at this point).

We’ve only scratched the surface…

Sanitizing the Firefox search engine plugins is a good start, but there is much more to do if you’re interested in circumventing the risks to your privacy and computer security that are inherent in any of the popular web browsers. For further information, please refer to my article, Firefox Configuration Guide for Privacy Freaks and Performance Buffs. You may find it helpful even if you aren’t using Firefox.

Resources

Special mention goes to ‘Thorin-Oakenpants’ (aka ‘Pants’) as well as the ‘ghacks’ crew and their GitHub repository where they host an excellent privacy and security centric custom user.js for Firefox, as well as a Wiki which is full of valuable information.

Change log

Click to expand...

15-Sep-2017

  • first publish

16-Sep-2017

  • added this change log
  • corrected an error in the pre-sanitized Wikipedia search plugin and re-uploaded sanitized_search_plugs.zip
  • added information as suggested by ‘Pants’ in his comment below, particularly details and resources regarding the followonsearch@mozilla.com.xpi system add-on in a new section titled “Removing the ‘Follow On Search’ system add-on
  • added Hulbee and MetaGer to the search engine list
  • added a “Decentralized” column to the search engine table
  • added resource: 5 Best Search Engines That Respect Your Privacy – BestVPN.com
  • misc. cleanup and edits

17-Sep-2017

  • corrected typo in metager URL
  • added “Requires JS / Cookies” column in search engine table
  • changed links for search engines in table to point to company/about page and added links to point to search page
  • added link to the ‘lite’ version of DDG
  • added a link to the uBO filters to block Startpage/Ixquick tracking images
  • misc. minor edits

18-Sep-2017

  • added “Client Required” column to search engine table
  • corrected some info regarding the search engines in the table
  • minor misc. edits

6 thoughts on “Firefox Search Engine Cautions and Recommendations

  1. Excellent article 12bytes. Really well done mate :)

    Some items for thought:
    – users should note some engines will require stripping tracking of search *results* (eg utms on google)
    – Firefox has a system add-on called Follow On Search, you should kill that (see ghacks user.js)
    – XML Search Engines Exporter/Importer is not Web Extension (yet?) so for FF57+ users, I guess we can use a portable legacy FF to create the file(s)?

    1. Also remember that in a lot of cases it is better in the first place to use a site specific search engine as well. For example, I have added an iTunes search engine so no-one but iTunes knows I search for Taylor Swift .. #GoTayTay :)

    2. thanks for your input Pants! much appreciated – i updated the article to address this stuff and added a section “Removing the ‘Follow On Search’ system add-on”

      Q: do you know how these system add-ons are loaded – are they loaded dynamically each time FF starts like other add-ons, or are they actually installed/cached some place? i’m wanting to be sure that deleting them is sufficient

      1. System add-ons are listed under about:support>”Firefox Features” – they act just like normal extensions AFAIK (except no disable/uninstall options). Delete the xpi and restart FF and you’re good to go.

        System add-ons are packaged with each Firefox application update (full updates at least). I use portable FF, so I am not sure about installed version behavior re dot releases. If I try to update and I have deleted some system add-on xpi files, the update fails and FF prompts for a full package instead (although the last update from 55.0->55.0.3 didn’t? Can’t remember! Dot releases may vary.). Anyway, I keep an eye on my system add-ons directory, and I only do updates now by downloading the portableapps.com packages (yes they include all the system add-ons too – both 32+64bit app/dirs)

        One of the reasons system add-ons exist, is so that patches/changes can be pushed without an app update. But the update check and update settings can have an effect. See: https://github.com/ghacksuserjs/ghacks-user.js/issues/172 . The ghacks user.js checks for app updates but lets you decide when to apply them – so until this bug is resolved, you won’t get system add-ons re-added or updated without your knowledge.

        You could also try 0505: “extensions.systemAddon.update.url” – if the system doesn’t know where to go, what can it do :) The only reason this is inactive in the js, is because this mechanism was initially designed to PUSH fixes – I think it was spurred on by a critical vulnerability in pdfjs a few years ago (Yes, pdfjs is a system add-on, but seems to be a special case compared to how/where it is stored)

        1. thanks for the clarification

          in my case, with Linux, no system add-ons were displayed in about:support and, actually, there wasn’t even a section called ‘Firefox Features’ – the ‘follow-on search’ add-on wasn’t present either, though others were

Leave a Reply

Your email address will not be published. Required fields are marked *