How can I disable searching and domain guessing from the Firefox Address Bar, while keeping other features?

22

9

I used to know how to configure this, but I can't seem to find it again. Here are some special features I would like to keep in the Address Bar, and some I would like to disable:

  • To Keep:

    • Bookmark "keyword" functionality. (i.e.: "go searchterm" = http://www.google.com/search?&q=searchterm)
    • Bookmark and History searching. (i.e.: "SuperUser" will display suggestions for the SuperUser homepage from my bookmarks, and SuperUser threads from my history.)
  • To Disable:

    • URL Bar Web Searches. (i.e.: "SearchTerm" will take me to a Google page with results for SearchTerm.)
    • TLD Guessing. (i.e.: "superuser" will turn into "superuser.com")

What defaults do I need to change so that the options I want kept remain available, while still turning off those I want disabled?

I'm currently running Firefox 10.

Iszi

Posted 2012-02-13T00:14:37.410

Reputation: 11 686

I have the same question but I'm using Firefox 61.0.2. Starting a bounty. – Wildcard – 2018-08-21T01:10:30.883

Evidently this does work on modern Firefox— mea culpa —but the instructions here are severely lacking in detail. – Wildcard – 2018-08-21T01:20:57.640

@Wildcard: What do you expect from your bounty ? A rewrite of the accepted answer with more detail ? – harrymc – 2018-08-21T06:53:24.943

@harrymc, well, I started the bounty before I figured out that the accepted answer DOES work on modern Firefox. So then I added the above comment. Yes, I suppose a rewrite with more detail. – Wildcard – 2018-08-21T06:57:08.067

@Wildcard: I added more detail to the accepted answer. Since your bounty was in error, you may either award the bounty to this answer, or you could flag the post and ask a moderator to undo your bounty. – harrymc – 2018-08-21T07:06:24.700

@harrymc, thanks, I didn't realize that was an option. I'll flag it for a moderator. – Wildcard – 2018-08-21T07:39:15.490

Answers

23

Go to about:config and set the following preferences to false:

browser.fixup.alternate.enabled

True (default): Try to fix up http://foo to http://(prefix)foo(suffix)
False: Do not second-guess the user

keyword.enabled

Determines whether to use keywords
True (default): Send non-URLs entered in the Location Bar to the URL specified in keyword.URL
False: Disable keywords

Where the documentation for keyword.URL says this :

URL to use for keyword lookups. Default value in Firefox 2.0 is
http://www.google.com/search? ie=UTF-8&oe=UTF-8&sourceid=navclient&gfns=1&q=

iglvzx

Posted 2012-02-13T00:14:37.410

Reputation: 21 611

The tld guessing solution just won't work, browser.fixup.alternate.enabled is broken, it just won't prepend/apend www. and .com to the typed text, but it will still treat any string that includes a dot as an url, so searching, for instance, for browser.fixup.alternate.enabled will fail, with ff - up to current nightly (37.0a1), at least - trying to open http://browser.fixup.alternate.enabled, instead! – None – 2014-12-05T07:28:35.350

I upvoted this but today I noticed it was not working by just disabling "browser.fixup.alternate.enabled" if you want to keep the URL bar web searches. When I searched "walkthrough" on the location bar, I expected to do a search on DuckDuckGo but instead it tried to open "walkthrough.com". This is a terrible Firefox issue for security and privacy that I will have to report if it is not already done. It can leak your search keyword and IP address to a third-party website without your consent. I think it is a good idea to disable "keyword.enabled" also to avoid search engine request by mistake. – baptx – 2018-08-11T09:26:27.027

4

Regarding search terms with dots - I did some searching and there's currently no way to turn this off, as the browser would not know how to distinguish between a search term and an actual URL. However, if your search term includes other words separated by spaces, for example "browser.fixup.alternate.enabled ff", then the search works. Likewise, you can use the keyword search ("g browser.fixup.alternate.enabled") to get around this.

There was some discussion on Bugzilla of a feature to check DNS (treat it as a URL) first and then if that fails, to do a keyword search, but no one's implemented that so far.

RubberDuckRabbit

Posted 2012-02-13T00:14:37.410

Reputation: 151

2

Hello from the future of 2019, where, as far as I can determine from the available about:config options mentioned above, it's still not possible to completely disable this behavior when your search term contains a period.

Screenshot of available "fixup" options in about:config

So it seems Firefox is forever going to assume that you really did mean to go to a web site called browser.fixup.alternate.enabled, or that an Awesome Bar search for vcruntime140.dll is a web site in some new ".dll" TLD (and help us all when that really does become an official TLD, because it'll be ripe for malware distribution).

There is a simple but satisfying workaround, though, that I happened upon by blind luck today: prefix your search query with a ?, or press Ctrl+K, which both focuses the Awesome Bar and adds the "?" prefix for you.

The Ctrl+K shortcut is documented in the Firefox help, but it's not really documented, because it doesn't mention the "?" prefix. Does that mean it's an undocumented behavior that could disappear at any time? Maybe. Enjoy it while it lasts.

The list of characters you can use to alter your search results is documented in the section called "Changing results on the fly" in this document, but it isn't clear from that document that using a question mark is a possible solution to the OP's problem. However, it is.

Pro tip: you can actually put the question mark anywhere in the query string, as long as it's not quoted, so browser.fixup.alternate.enabled? will do what you expect, giving you results for that search term in your default search engine. Not sure if that's a feature, or just a useful side-effect, since something with a "?" in it obviously isn't a hostname.

TheDudeAbides

Posted 2012-02-13T00:14:37.410

Reputation: 465

0

Chrome tests whether the string has valid domain syntax and ends in a known tld before assuming it's a URL. This gives far fewer annoying false positives than Firefox's stupid "it's got a dot" criterion.

Denis Howe

Posted 2012-02-13T00:14:37.410

Reputation: 309