Coder Social home page Coder Social logo

firefox-selection-fix's Introduction

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"

firefox-selection-fix's People

Contributors

biziclop avatar sebastiansimon avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.