From f5d87161c73233766c93dcda7ef781ea5277d570 Mon Sep 17 00:00:00 2001 From: Thorin-Oakenpants Date: Sat, 23 Sep 2017 14:56:07 +1200 Subject: [PATCH] Created 1.6 Bulk Pref Resetting [Scratchpad] (markdown) --- 1.6-Bulk-Pref-Resetting-[Scratchpad].md | 77 +++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 1.6-Bulk-Pref-Resetting-[Scratchpad].md diff --git a/1.6-Bulk-Pref-Resetting-[Scratchpad].md b/1.6-Bulk-Pref-Resetting-[Scratchpad].md new file mode 100644 index 0000000..01dbb81 --- /dev/null +++ b/1.6-Bulk-Pref-Resetting-[Scratchpad].md @@ -0,0 +1,77 @@ +### :small_orange_diamond: The Overview + +In our [changelog](https://github.com/ghacksuserjs/ghacks-user.js/search?q=label%3Achangelog&type=Issues&utf8=✓) for each release, we list preferences that have been: +- REMOVED from the user.js +- made INACTIVE (i.e commented out) in the user.js +- DEPRECATED (Section 9999) +- become REDUNDANT or CONFLICT with, `privacy.resistFingerprinting` (RFP) (Section 4600) + +Removed prefs are nowhere to be found, and we have no easy answer except to pay attention to the changelogs. As for the rest: sections 4600 and 9999 list items by Firefox version, and prefs we've made inactive are still there, just harder to spot. Note: That even if you are on ESR, sooner or later, the deprecated prefs will still apply. + +### :small_orange_diamond: The Issue + +So all these REMOVED, INACTIVE, DEPRECATED, and REDUNDANT prefs should be reset in `about:config`. And over time, the list builds up. Some are harmless (deprecated items will have no effect), but others are vital (e.g. `dom.indexedDB.enabled` is now used by some Extensions 1 (e.g uBlock Origin, uMatrix, Stylus). And some items in 4600 actually interfere with `privacy.resistFingerprinting`. Add to this any prefs you may have made inactive yourself. + +So the issue is :question: How do you make sure all these prefs in your user.js have been reset in about:config? Over time you **will** miss something. + +1 `Extensions` = Web Extensions API, `Legacy Extensions` = legacy APIs or the Add-on SDK. + +### :small_orange_diamond: The Solution + +All of the above can be reset manually. Not so bad if you do it on each release and watch the changelogs etc. But this is time consuming, prone to human error, and not automated in any way. We also make prefs and sections INACTIVE for a reason, so it pays to be in "sync". This can also be used when applying a `user.js` to an existing profile for the first time. + +- You can run a script in Scratchpad and do it all in one hit +- You still need to compile a list of your + * INACTIVE prefs, all DEPRECATED (9999) prefs, all RFP ALT (4600) prefs + * - ^^ i.e some SECTIONS are commented out, thus the prefs are "effectively" commented out, but the pref line itself isn't. So you can't just search for `// user_pref` + * If you know what you're doing, it's fairly trivial... otherwise... +- Good news, everyone! + * Finish this bit, link to atomGit? + * Suggest 4 lists as per bullet list at top of page + +NOTE: You could actually reset **every** **pref** in the user.js, and your ACTIVE prefs will simply be reapplied on the next Firefox start. + +### :small_orange_diamond: The Script + +The **sample** script below contains the prefs we have REMOVED up to Release 55-alpha + +* :exclamation: **open about:config (so that Services is available for scratchpad)** +* ^^ Read that again +* Press Shift+F4 to open the Scratchpad +* Paste **your** script +* Make sure the final pref does not have a trailing comma +* Run it +* Watch the console for output +* Restart so your user.js (and override.js etc) is reapplied + +```js +(function() { + let ops = [ + /* removed in ghacks user.js v52-55 */ + /* 52-alpha */ + 'browser.search.reset.enabled', + 'browser.search.reset.whitelist', + /* 54-alpha */ + 'browser.migrate.automigrate.enabled', + 'services.sync.enabled', + 'webextensions.storage.sync.enabled', + 'webextensions.storage.sync.serverURL', + /* 55-alpha */ + 'dom.keyboardevent.dispatch_during_composition', // default is false anyway + 'dom.vr.oculus.enabled', // covered by dom.vr.enabled + 'dom.vr.openvr.enabled', // ditto + 'dom.vr.osvr.enabled', // ditto + 'extensions.pocket.api', // covered by extensions.pocket.enabled + 'extensions.pocket.oAuthConsumerKey', // ditto + 'extensions.pocket.site' // ditto + ] + + for (let i=0, len=ops.length; i < len; i++) { + if (Services.prefs.prefHasUserValue(ops[i])) { + Services.prefs.clearUserPref(ops[i]); + if (!Services.prefs.prefHasUserValue(ops[i])) { console.log("reset", ops[i]); } + } + } +})(); +``` +