3.2 Applying Your Changes

Thorin-Oakenpants edited this page Dec 25, 2017 · 4 revisions

:small_orange_diamond: The Issue

Keeping track of all your changes/additions and keeping up to date with all our changes is hard and problematic. We make a lot of changes - not just adding and deprecating preferences, or flipping them from active to inactive, or changing their values, but also making descriptions better, syntax tweaks, adding/removing references, and even whole section revamps and re-ordering. Doing a file comparison and re-applying your own changes is time consuming, prone to human error, and not really feasible for most people.

:small_orange_diamond: The Solution

Keep your changes in a SEPARATE file as your master copy (see the example below), and manually append them to the end of the user.js when you update replace it with the latest version. This simplifies updating the user.js. Then all you have to do is follow our easy, succinct changelogs to discover new items and changes.

We have created some updater scripts to do all of this for you - i.e backup your user.js, create a new user.js using our current master, and append your overrides - BUT you need to follow our file naming convention.

Note the caveats below including having to manually reapply any one-char section switches if they differ from our master.

PRO TIP It is a good idea to add our parrot pref for troubleshooting (see example below)

:small_blue_diamond: user-overrides.js [recommended]

Create a user-overrides.js file in your profile directory. This acts as the master copy of all your tweaks, and our updater scripts will auto append its contents for you to the end of the user.js after it downloads the current ghacks user.js master.

:small_blue_diamond: profile/preferences/*.js [old method]

Firefox 58+ no longer supports using profile/preferences/xxx.js - 1413413. In Firefox versions where this is supported, there is no need to append the contents to the user.js as they are applied last (after user.js) on a Firefox startup.

:small_orange_diamond: Example

Lets say you don't want to limit fonts and need mathml

  • In your profile/user.js (which is the ghacks user.js) you have
/* 1401: disable websites choosing fonts (0=block, 1=allow) ***/
user_pref("browser.display.use_document_fonts", 0);

/* 1405: disable WOFF2 (Web Open Font Format) ***/
user_pref("gfx.downloadable_fonts.woff2.enabled", false);

/* 2663: disable MathML (Mathematical Markup Language) (FF51+) ***/
user_pref("mathml.disabled", true);
  • In a profile/user-overrides.js you override them
/*** MY OVERRIDES ***/
user_pref("_user.js.parrot", "overrides section syntax error");
user_pref("browser.display.use_document_fonts", 1); // 1401
user_pref("gfx.downloadable_fonts.woff2.enabled", true); //1405
user_pref("mathml.disabled", false); // 2663
user_pref("_user.js.parrot", "SUCCESS");

The next time you update the profile/user.js and replace it, all you have to do is append the contents of your existing tweaks from profile/user-overrides.js. Or if you use our updater scripts, it will do this manual step for you as well.

:small_orange_diamond: Caveats

You will need to monitor your small set of overrides due to Firefox changes. Just keep an eye on things is all I'm saying

  • One-Char Switches
    • Several sections in the user.js have one-char switches to enable/disable the entire section (e.g. deprecated items by ESR version). You will have to remember to do these manually if required.
  • Deprecated Items
    • A deprecated item will not remove, or comment itself out in your override.js, you will have to do it manually (and reset in about:config to get rid of it, which you would need to do anyway). No harm, it will just not be a pref that does anything anymore.
  • Changes to Default Values
    • Example user_pref("security.tls.version.min", 3);
    • You override it with the Firefox default value of 1
    • In the future Firefox changes their default to 2 due to security concerns, but now you're stuck with a value of 1 and you didn't pick up on it
  • Hidden Pref Default Values
    • Most hidden prefs seem to be boolean (true or false), so these shouldn't be an issue, but not all are. Here's one: user_pref("extensions.enabledScopes", 1); // (hidden pref)
    • If you right-click and reset in about:config it simply clears itself. What is the default value? If you know it, that's great. If you don't...
    • A solution here is to add a section to your override listing prefs to comment out in the user.js and reset in about:config. Just re-apply it on each update.
/*** MY OVERRIDES ***/
user_pref("browser.display.use_document_fonts", 1); // 1401
user_pref("gfx.downloadable_fonts.woff2.enabled", true); //1405
user_pref("mathml.disabled", false); // 2663

// 2668: extensions.enabledScopes
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.