An annoying little feature of Firefox emerges when you surf on Linux. I was quite baffled at first as to whether it was actually a feature or if my system had been compromised, as seemingly random pages would load up for no apparent reason.

The cause is the standard X11/Unix selection buffer behavior. In Unix-like systems, highlighting text automatically copies it to a primary selection buffer, and middle-clicking pastes it. By default, Firefox takes the initiative to resolve whatever is in that buffer as a URL—or perform a search query on it—if you happen to middle-click anywhere on the open window.

If you use middle-click to scroll or happen to misclick, this triggers constantly.

Luckily, there is a very easy fix:

  1. Open a new tab in Firefox and navigate to about:config in the address bar.
  2. Accept the warning dialog to proceed.
  3. Search for the preference name: middlemouse.contentLoadURL.
  4. Double-click it (or click the toggle button) to change its value from true to false.

That is it—no more unexpected page loads.

On a more security-conscious note, this behavior can also be construed as a clipboard data leak: accidental middle-clicks send selection contents to search engines or external servers without your explicit intent. Disabling it is a good best practice for privacy.