|
1 | 1 | /*** |
2 | | - This will reset the preferences that have been removed completely from the arkenfox user.js. |
| 2 | + This will reset the preferences that have been removed completely from the arkenfox user.js. |
3 | 3 |
|
4 | | - Last updated: 25-May-2021 |
| 4 | + Last updated: 25-May-2021 |
5 | 5 |
|
6 | | - For instructions see: |
7 | | - https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] |
| 6 | + For instructions see: |
| 7 | + https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] |
8 | 8 | ***/ |
9 | | - |
10 | | -(function() { |
11 | | - let ops = [ |
| 9 | + |
| 10 | +(() => { |
| 11 | + |
| 12 | + if ('undefined' === typeof(Services)) return alert('about:config needs to be the active tab!'); |
| 13 | + |
| 14 | + const aPREFS = [ |
12 | 15 | /* removed in arkenfox user.js */ |
13 | 16 | /* 52-alpha */ |
14 | 17 | 'browser.search.reset.enabled', |
|
240 | 243 | 'security.ssl.enable_ocsp_stapling', |
241 | 244 | /* reset parrot: check your open about:config after running the script */ |
242 | 245 | '_user.js.parrot' |
243 | | - ] |
| 246 | + ]; |
| 247 | + |
| 248 | + console.clear(); |
244 | 249 |
|
245 | | - if("undefined" === typeof(Services)) { |
246 | | - alert("about:config needs to be the active tab!"); |
247 | | - return; |
248 | | - } |
249 | | - |
250 | 250 | let c = 0; |
251 | | - for (let i = 0, len = ops.length; i < len; i++) { |
252 | | - if (Services.prefs.prefHasUserValue(ops[i])) { |
253 | | - Services.prefs.clearUserPref(ops[i]); |
254 | | - if (!Services.prefs.prefHasUserValue(ops[i])) { |
255 | | - console.log("reset", ops[i]); |
| 251 | + for (const sPname of aPREFS) { |
| 252 | + if (Services.prefs.prefHasUserValue(sPname)) { |
| 253 | + Services.prefs.clearUserPref(sPname); |
| 254 | + if (!Services.prefs.prefHasUserValue(sPname)) { |
| 255 | + console.info('reset', sPname); |
256 | 256 | c++; |
257 | | - } else { console.log("failed to reset", ops[i]); } |
| 257 | + } else console.warn('failed to reset', sPname); |
258 | 258 | } |
259 | 259 | } |
260 | | - |
| 260 | + |
261 | 261 | focus(); |
262 | | - |
263 | | - let d = (c==1) ? " pref" : " prefs"; |
264 | | - if (c > 0) { |
265 | | - alert("successfully reset " + c + d + "\n\nfor details check the Browser Console (Ctrl+Shift+J)"); |
266 | | - } else { alert("nothing to reset"); } |
267 | | - |
| 262 | + |
| 263 | + const d = (c==1) ? ' pref' : ' prefs'; |
| 264 | + alert(c ? 'successfully reset ' + c + d + "\n\nfor details check the console" : 'nothing to reset'); |
| 265 | + |
| 266 | + return 'all done'; |
| 267 | + |
268 | 268 | })(); |
0 commit comments