A POSIX shell script for updating your Firefox user.js from privacy-handbuch.de

TotallyLeGIT 954e8c1009 added a few general words and small improvements 2 days ago
LICENSE.txt d618345d2b welp, I am a License 2 weeks ago
README.md 954e8c1009 added a few general words and small improvements 2 days ago
updater 8170f761a3 add support for multiple profile paths (-p) 1 week ago

README.md

About

This is a POSIX compliant shell script for downloading and updating the Firefox user.js from Privacy-Handbuch.

Usage

This script will download the user.js of your choice into the selected profile directory. It is recommended to close your Firefox before changing the user.js. Changes will take effect at the next start of the browser.

After downloading you will first need to make the script executable: chmod +x updater. You can either run it via /path/to/updater or put it in one of your $PATH directories to be able to just call updater (or whatever file name you have chosen).

If this script is not located in your Firefox's user profile directory (e. g. ~/.mozilla/firefox/yourprofile.default) you have to specify your profile directory with -p PROFILE or select it via -l.

Just like the ghacks user.js updater, this script will search for a user-overrides.js in your selected profile directory and append it to the downloaded user.js. The options from user-overrides.js will take precedence over those from the user.js.

For automated updating you should at least use the option -y so the updater won't hang waiting for your confirmation. You can also have the updater update itself automatically through the option -s, though I would not recommend this securitywise. Alternatively, you can let the updater check for updates with -u. This will ask whether you want to update, so you can check out the changes beforehand.

Example usage

Manual updating:
updater -ulc moderat -o "/home/user/.mozilla/firefox/yourprofile.default/overrides.js"

This will search for updates of this updater (u), present you a list of Firefox profiles to select one from (-l), install the moderat version of the user.js (-c moderat) and append the given override file to the resulting user.js (-o "…"). The last option is needed because the name of the file is not user-overrides.js.

Automatic updating (for usage with cron etc.):
updater -dsyp "/home/user/.mozilla/firefox/yourprofile.default"

This will create a diff file for later comparison of the current and older versions of the user.js (-d), update the updater silently (-s), update the user.js without asking for confirmation (-y) and operate in the given Firefox profile folder. The last option is needed if the updater resides in a different directory than your profile.

Kudos

This script is based on the ghacks user.js updater.sh. Thanks for all your work!