Disable search and autocomplete on url bar of Firefox

The default configuration of Firefox can cause a search to be performed when an url is wrong using the main bar, or auto-suggestion to be performed silently. This setting may disclose to third parties local path when mistyped.

At the end of this howto, Firefox will be back to a status where the user take back more control of searches, reducing disclosed data to external services. You can also disable the suggestions when typing.

How to disable automatic search

To disable search on url bar of Firefox, first re-enable the double search bar:

  1. Go to Settings
  2. Go to Search settings
  3. On Search Bar, select the 2 bar option

Now disable the search on the url bar:

  1. Visit on the main bar about:config
  2. Accept to continue
  3. Search “keyword”
  4. Change the status from true to false (double click on it)

Now if you try to type a keyword, you will be redirected to the keyword.com website, e.g. boh will redirect to boh.com.

Data aren’t sent anymore to other search engines except for autocompletes, but you can disable it following next steps.

Disable search autocomplete on urlbar

  1. Go to about:config
  2. Search browser.urlbar.suggest.searches
  3. Set value from true to false (double click on it)

Now if you type a search on the url bar, the search will be performed on the history alone, but if you use the search bar autocomplete will works normally.

Disable search autocomplete on search bar

To completely disallow search suggestion on the new right searchbar:

  1. Look for browser.search.suggest.enabled on about:config
  2. Double click on it to set false

Disable auto .com

Note: if you wrongly type a search in the url bar, it will be autocompleted as YOUR-SEARCH.com (YOUR SEARCH + “.com”).

To disable the “.com” suffix or the “www” prefix:

  1. Look for browser.fixup.alternate.enabled on about:config
  2. Double click on it to set false

Final behaviour

With all these changes applied:

  1. The url bar will look for a URL exactly as you’ve typed (except for the https / http that will be autocompleted)
  2. The search bar will perform the search on the search engine you’ve specified
  3. No silent request will be forwarded to search engines on url bar or search bar (as far as I know)

Character substitution on Jquery

Here an easy way to search and replace each occurrence a group of characters (in this case underscore and minus) with another (in this case a space) on a specified element (in this case each A), using Jquery javascript library.

$("a").each(function() {
   $(this).html($(this).html().replace(/[_-]/g," "));

The first argument passed on replace is a regex, if you just pass a single character (like “_” or “-“) only first occurrence for each element.

Real world usage: I use this onto a long page, where a table has long filenames with underscore and minus in place of spaces. This trick allows in my case to show tables nicely, without caring on a mass substitution via server side scripting.

See also: