A script that disables the broken clickSelectsAll
behavior of Firefox.
See this answer on Super User for full context and an explanation of the script.
Various browsers have started adopting a particular behavior when clicking the address bar: the entire URL is selected.
This goes against good UX practices.
In Firefox, there used to be the preferences browser.urlbar.clickSelectsAll
, browser.urlbar.update1
, and browser.urlbar.update2
to control this behavior and other updates, but the latter two were always expected to be temporary.
Around March 2020, the browser.urlbar.clickSelectsAll
preference has been removed.
Since then, this bug has been under discussion, where a patch has been suggested — this would involve recompiling Firefox from scratch.
As the “clickSelectsAll
doesn’t work” duplicates accumulate on Bugzilla, one of these has received a comment by Stephen McCarthy which describes a workaround that involves editing internal Firefox files.
This workaround looks like the simplest approach, but the approach doesn’t work as-is.
This repo provides a script that attempts to give us users the browser.urlbar.clickSelectsAll = false
experience back.
The script works for me. And I’m running Firefox Nightly on Arch Linux. This is the software setup that I’ve tested — it may work for other setups, too, and this script is likely to work with later versions as well:
- Arch Linux (
core/linux
5.6.15.arch1-1
through5.7.7.arch1-1
) - Gnome Desktop (
extra/gnome-desktop
1:3.36.3.1-1
through1:3.36.4-1
) - Firefox Nightly 79.0a1 (2020-06-11) through 80.0a1 (2020-07-10) (64-bit)
extra/unzip
6.0-14
extra/zip
3.0-9
Note: the versions will only be updated for significant changes to the script.
See my Super User answer for detailed steps.
Before running the script:
- Download the script.
- Update Firefox and let Firefox install the updates.
- Close Firefox.
- Set the script as a runnable file.
- Execute the script in an interactive terminal.
Either click it in your file manager, then pick the “Run in terminal” option, or run it directly as e.g.
bash ./Firefox\ Selection\ Fix.sh
. - The script should find your Firefox install path automatically.
If not, edit it and put the correct path where it says
Fallback path
; the correct path contains abrowser
directory with anomni.ja
in it. - The script checks if you have write access to your Firefox install path and to
/tmp
. If not, you’ll be asked to enter your root password. You can also run the script assudo
instead. - If you’re running the script the first time after boot, a temporary backup of the internal application resources (
browser/omni.ja
) of your Firefox installation is created (located in/tmp
). If you run the script again, you’ll be asked if the backup should be created (and overwrite the old one); press y and Enter if you’re sure that your current Firefox installation is working properly. - After a few seconds, you should be able to launch Firefox normally.
Don’t worry about the
unzip
error messages. If everything went well, you should now be able to launch a fixed Firefox with an improved URL bar selection behavior (and search bar, too)! Press Enter to exit. - However, if Firefox won’t run properly, close Firefox, and restore the backup by typing r and Enter. The backup will be restored and the script will exit. Start Firefox again to go back to normal.
Let me now if something went wrong, by creating a new issue. Provide details about terminal output, your system setup, and your software versions.
The script offers an opportunity to test Firefox and restore the backup in case something went wrong. If you want to restore the backup later on, type these lines into the terminal. Make sure if you need to run this as root, and double-check the file paths.
firefox_dir=$(whereis firefox | cut -d ' ' -f 2)
cp -p /tmp/omni.ja~ "$firefox_dir/browser/omni.ja"
touch "$firefox_dir/browser/.purgecaches"