|
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 have been deprecated by Mozilla |
5 | | - and used in the arkenfox user.js |
| 4 | + This will reset the preferences that have been deprecated by Mozilla |
| 5 | + and used in the arkenfox user.js |
6 | 6 |
|
7 | | - It is in reverse order, so feel free to remove sections that do not apply |
| 7 | + It is in reverse order, so feel free to remove sections that do not apply |
8 | 8 |
|
9 | | - For instructions see: |
10 | | - https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] |
| 9 | + For instructions see: |
| 10 | + https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts] |
11 | 11 | ***/ |
12 | 12 |
|
13 | | -(function() { |
14 | | - let ops = [ |
| 13 | +(() => { |
| 14 | + |
| 15 | + if ('undefined' === typeof(Services)) return alert('about:config needs to be the active tab!'); |
| 16 | + |
| 17 | + const aPREFS = [ |
15 | 18 | /* deprecated */ |
16 | 19 |
|
17 | 20 | /* 78 */ |
|
220 | 223 |
|
221 | 224 | /* reset parrot: check your open about:config after running the script */ |
222 | 225 | '_user.js.parrot' |
223 | | - ] |
| 226 | + ]; |
| 227 | + |
| 228 | + console.clear(); |
224 | 229 |
|
225 | | - if("undefined" === typeof(Services)) { |
226 | | - alert("about:config needs to be the active tab!"); |
227 | | - return; |
228 | | - } |
229 | | - |
230 | 230 | let c = 0; |
231 | | - for (let i = 0, len = ops.length; i < len; i++) { |
232 | | - if (Services.prefs.prefHasUserValue(ops[i])) { |
233 | | - Services.prefs.clearUserPref(ops[i]); |
234 | | - if (!Services.prefs.prefHasUserValue(ops[i])) { |
235 | | - console.log("reset", ops[i]); |
| 231 | + for (const sPname of aPREFS) { |
| 232 | + if (Services.prefs.prefHasUserValue(sPname)) { |
| 233 | + Services.prefs.clearUserPref(sPname); |
| 234 | + if (!Services.prefs.prefHasUserValue(sPname)) { |
| 235 | + console.info('reset', sPname); |
236 | 236 | c++; |
237 | | - } else { console.log("failed to reset", ops[i]); } |
| 237 | + } else console.warn('failed to reset', sPname); |
238 | 238 | } |
239 | 239 | } |
240 | | - |
| 240 | + |
241 | 241 | focus(); |
242 | | - |
243 | | - let d = (c==1) ? " pref" : " prefs"; |
244 | | - if (c > 0) { |
245 | | - alert("successfully reset " + c + d + "\n\nfor details check the Browser Console (Ctrl+Shift+J)"); |
246 | | - } else { alert("nothing to reset"); } |
247 | | - |
| 242 | + |
| 243 | + const d = (c==1) ? ' pref' : ' prefs'; |
| 244 | + alert(c ? 'successfully reset ' + c + d + "\n\nfor details check the console" : 'nothing to reset'); |
| 245 | + |
| 246 | + return 'all done'; |
| 247 | + |
248 | 248 | })(); |
0 commit comments