Skip to content

A script that disables the broken clickSelectsAll behavior of Firefox.

License

Notifications You must be signed in to change notification settings

biziclop/firefox-selection-fix

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Firefox Selection Fix – Click will no longer select all in your URL bar

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.

What is this script for?

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.

Where does this script work?

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:

Note: the versions will only be updated for significant changes to the script.

How to run the script?

See my Super User answer for detailed steps.

Preliminaries

Before running the script:

  1. Download the script.
  2. Update Firefox and let Firefox install the updates.
  3. Close Firefox.
  4. Set the script as a runnable file.

Running the script

  1. 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.
  2. 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 a browser directory with an omni.ja in it.
  3. 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 as sudo instead.
  4. 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.
  5. 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.
  6. 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.

Restoring the backup

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"

About

A script that disables the broken clickSelectsAll behavior of Firefox.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%