3.1 Resetting Inactive Prefs [Scripts]

earthlng edited this page Apr 24, 2018 · 17 revisions

:exclamation: Read the instructions & backup your profile before running any of the scripts mentioned here

:small_orange_diamond: The Issue

Our changelogs are lists which contain, among other things, information on prefs that have been REMOVED, made INACTIVE (i.e commented out), DEPRECATED (Section 9999), or become REDUNDANT/CONFLICT with privacy.resistFingerprinting (RFP) (Section 4600).

So some or all of these REMOVED, INACTIVE, DEPRECATED, and REDUNDANT prefs need to be manually reset in about:config, depending on your configuration. And over time, the list builds up. Some are harmless (deprecated items will have no effect), but others are vital (prefs and sections are INACTIVE for a reason, so it pays for your prefs.js to be in "sync"). Add to this any prefs you may have made inactive yourself. A REMOVED pref is particularly tricky as it is no longer referenced in the user.js.

So the issue is :question: How do you make sure all the INACTIVE/REMOVED prefs in your user.js have been reset in about:config? Over time you will miss something - doing this manually is time consuming and prone to human error.

:small_orange_diamond: The Solution

The solution is simple. Automate it, and reset every single pref in the user.js regardless of whether it is active or inactive. Then restart Firefox and all your ACTIVE prefs are reapplied. The end result being all your INACTIVE ones have been reset.

And that's exactly what our prefsCleaner script does.


WARNING: If you changed any prefs that are INACTIVE in the user.js manually in about:config or the Options then those will get reset too! (for example browser.startup.homepage)

For a less risky solution use some of our scratchpad scripts which we have broken down into a number of smaller scripts. But depending on which ones you run the same warning applies!

Think of it as an opportunity to increase your automation by setting those manually controlled settings in your user.js (or append them to your user-overrides.js file if you use our Updater Scripts).


:small_blue_diamond: prefsCleaner

Download the prefsCleaner for Windows or for Linux/Mac and run it in your profile directory with Firefox closed.

NOTE: This does not cover prefs we REMOVED from the ghacks user.js, see the Scratchpad section for those.


:small_blue_diamond: Scratchpad Scripts (based on ghacks user.js)

Our scratchpad cleanup scripts (ghacks-clear-*.js) are stored here.

The REMOVED script is the ONLY single point of reference for everything we once tinkered with, but is now gone. It's a short list, but highly recommended that you manually check them or run the script.

How To Run A Scratchpad Script

  • Close Firefox and backup your profile
  • (Optional) Disable the network connection 1
  • Start Firefox
  • Open the Developer>Browser Console>Logging for any output
    • the script will list every pref it resets in the console
    • it only resets prefs if they are user set/ modified
  • Load about:config (so that Services is available for scratchpad)
    • Read that again :exclamation: the about:config tab must have focus in order to run the script
  • Press Shift+F4 to open the Scratchpad and clear the contents
  • Open your script (.js file) or paste it
    • If pasting is not allowed, change devtools.selfxss.count to a high number e.g. 100
    • If you edited the list of prefs in the script, make sure the last pref does not have a trailing comma
  • Run it
  • Check the console to see which prefs were reset
    • if you see something you want to keep, add it to your user.js (or your overrides)
  • Restart Firefox
    • Some prefs require a restart
    • A restart will reapply your user.js
  • Re-enable the network connection

1 Blocking Firefox from the internet ensures it cannot act on your reset preferences in the period before you restart it, such as app and extension auto-updating, or downloading unwanted components (system addons, GMP etc). It depends on what you're resetting and how long before you restart.

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.