|
1 | 1 | /*** |
2 | | - Version: up to and including FF/ESR78 |
| 2 | + Version: up to and including FF/ESR78 |
3 | 3 |
|
4 | | - This will reset the preferences that are under sections 4600 & 4700 in the |
5 | | - arkenfox user.js. These are the prefs that are no longer necessary, or they |
6 | | - conflict with, privacy.resistFingerprinting if you have that enabled. |
| 4 | + This will reset the preferences that are under sections 4600 & 4700 in the |
| 5 | + arkenfox user.js. These are the prefs that are no longer necessary, or they |
| 6 | + conflict with, privacy.resistFingerprinting if you have that enabled. |
7 | 7 |
|
8 | | - For instructions see: |
9 | | - https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] |
| 8 | + For instructions see: |
| 9 | + https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] |
10 | 10 | ***/ |
11 | | - |
12 | | -(function() { |
13 | | - let ops = [ |
| 11 | + |
| 12 | +(() => { |
| 13 | + |
| 14 | + if ("undefined" === typeof(Services)) return alert('about:config needs to be the active tab!'); |
| 15 | + |
| 16 | + const aPREFS = [ |
14 | 17 | /* section 4600 */ |
15 | 18 | 'dom.maxHardwareConcurrency', |
16 | 19 | 'dom.enable_resource_timing', |
|
37 | 40 | 'general.oscpu.override', |
38 | 41 | /* reset parrot: check your open about:config after running the script */ |
39 | 42 | '_user.js.parrot' |
40 | | - ] |
| 43 | + ]; |
| 44 | + |
| 45 | + console.clear(); |
41 | 46 |
|
42 | | - if("undefined" === typeof(Services)) { |
43 | | - alert("about:config needs to be the active tab!"); |
44 | | - return; |
45 | | - } |
46 | | - |
47 | 47 | let c = 0; |
48 | | - for (let i = 0, len = ops.length; i < len; i++) { |
49 | | - if (Services.prefs.prefHasUserValue(ops[i])) { |
50 | | - Services.prefs.clearUserPref(ops[i]); |
51 | | - if (!Services.prefs.prefHasUserValue(ops[i])) { |
52 | | - console.log("reset", ops[i]); |
| 48 | + for (const sPname of aPREFS) { |
| 49 | + if (Services.prefs.prefHasUserValue(sPname)) { |
| 50 | + Services.prefs.clearUserPref(sPname); |
| 51 | + if (!Services.prefs.prefHasUserValue(sPname)) { |
| 52 | + console.info("reset", sPname); |
53 | 53 | c++; |
54 | | - } else { console.log("failed to reset", ops[i]); } |
| 54 | + } else console.warn("failed to reset", sPname); |
55 | 55 | } |
56 | 56 | } |
57 | | - |
| 57 | + |
58 | 58 | focus(); |
59 | | - |
60 | | - let d = (c==1) ? " pref" : " prefs"; |
61 | | - if (c > 0) { |
62 | | - alert("successfully reset " + c + d + "\n\nfor details check the Browser Console (Ctrl+Shift+J)"); |
63 | | - } else { alert("nothing to reset"); } |
64 | | - |
| 59 | + |
| 60 | + const d = (c==1) ? " pref" : " prefs"; |
| 61 | + alert(c ? "successfully reset " + c + d + "\n\nfor details check the console" : 'nothing to reset'); |
| 62 | + |
| 63 | + return 'all done'; |
| 64 | + |
65 | 65 | })(); |
| 66 | + |
0 commit comments