Skip to content

Commit a231c1e

Browse files
authored
Update arkenfox-clear-RFP-alternatives.js
1 parent f229a3c commit a231c1e

File tree

1 file changed

+29
-28
lines changed

1 file changed

+29
-28
lines changed
Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
/***
2-
Version: up to and including FF/ESR78
2+
Version: up to and including FF/ESR78
33
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.
77
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]
1010
***/
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 = [
1417
/* section 4600 */
1518
'dom.maxHardwareConcurrency',
1619
'dom.enable_resource_timing',
@@ -37,29 +40,27 @@
3740
'general.oscpu.override',
3841
/* reset parrot: check your open about:config after running the script */
3942
'_user.js.parrot'
40-
]
43+
];
44+
45+
console.clear();
4146

42-
if("undefined" === typeof(Services)) {
43-
alert("about:config needs to be the active tab!");
44-
return;
45-
}
46-
4747
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);
5353
c++;
54-
} else { console.log("failed to reset", ops[i]); }
54+
} else console.warn("failed to reset", sPname);
5555
}
5656
}
57-
57+
5858
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+
6565
})();
66+

0 commit comments

Comments
 (0)