Current Version plugins

Automation comes to the Ghacks user.js configuration for Firefox

The Ghacks user.js configuration file for Firefox contains a list of mostly privacy and security-related preferences for the web browser.

Firefox updates may change preferences. Updates may remove preferences, modify them, or introduce them. That’s the core reason why the user.js file is regularly updated.

Users who make use of the Ghacks user.js file had to download the new file from the GitHub repository until now to get the updated version of it for the most recent version of the Firefox browser.

The replacement on the local system depends mostly on how the user.js file is applied. Some users merely replace the old with the new, others go through the list of changes manually to make modifications to their copy.

Leftovers are common regardless of the method used. If you remove a preference from the user.js file, it is not automatically removed from Firefox for instance. You had to reset the preference in about:config to get rid of it for example.

The manual resetting of preferences is error-prone. While you can ignore the issue entirely, you’d end up with a growing number of preferences that are either inactive or no longer working.

Automation of the process

The team, earthling, claustromaniac, and overdodactyl, created scripts to address this issue. The following scripts are available:

Using prefsCleaner.bat

prefs cleaner

You need to copy the prefsCleaner.bat file to the Firefox profile folder. Open about:support in the Firefox address bar and click on the “open folder” button under Application Basics to open the profile folder.

Make sure to close Firefox before you run the batch script in the profile folder. The batch script resets any preference that is also in the user.js file.

The data from the user.js file is then applied again on the next start of the web browser.

Using Scratchpad scripts

scratchpad

Scratchpad scripts will reset preferences as well. Unlike prefsCleaner.bat, these scripts can also reset preferences that are not in the current user.js file.

Several scripts are provided that you may run to reset removed or deprecated preferences, among others.

Running them is a bit complicated, however. You may want to create a backup of the entire Firefox profile before you start.

  1. Optional: disable the Internet connection of Firefox (or the device).
  2. Start the Firefox web browser.
  3. Load about:config so that it is the active tab of the browser.
  4. Use Shift-F4 to open Scratchpad.
  5. Use the open button to load the script.
  6. You can paste the content as well, but need to type “allow pasting” first to enable that functionality.
  7. Select run to execute the script.
  8. Check Developer>Browser Console>Logging for output.
  9. Restart the Firefox web browser.
  10. If you disabled Internet, re-enable it.

Updater scripts

Updater scripts are available for Windows, Mac and Linux machines. The following happens when you run the scripts without parameters:

  1. Backup of the Firefox user.js file.
  2. Download of the most recent Ghacks user.js file.
  3. Use the file user-overrides.js if it exists.

Users who made changes to the Ghacks user.js file prior to adding it to Firefox can use the user-overrides.js file to retain those changes while using updater scripts.

Basically, what you do is add any modified preference to the user-overrides.js file so that the modifications are retained throughout updates. The updater scripts use the file automatically if it exists.

The Windows version of the updater script supports command line parameters. You can run the script with the -Merge pararameter to merge user-overrides.js preferences with the user.js preferences instead of appending them at the end of the user.js file.

References:

Ghacks needs you. You can find out how to support us here or support the site directly by becoming a Patreon. Thank you for being a Ghacks reader.

The post Automation comes to the Ghacks user.js configuration for Firefox appeared first on gHacks Technology News.


Leave a Comment

Your email address will not be published. Required fields are marked *

Menu Title