mirror of
				https://github.com/arkenfox/user.js.git
				synced 2025-11-03 23:35:26 +01:00 
			
		
		
		
	Update arkenfox-clear-removed.js
This commit is contained in:
		@@ -7,8 +7,11 @@
 | 
			
		||||
  https://github.com/arkenfox/user.js/wiki/3.1-Resetting-Inactive-Prefs-[Scripts]
 | 
			
		||||
***/
 | 
			
		||||
 | 
			
		||||
(function() {
 | 
			
		||||
  let ops = [
 | 
			
		||||
(() => {
 | 
			
		||||
 | 
			
		||||
  if ('undefined' === typeof(Services)) return alert('about:config needs to be the active tab!');
 | 
			
		||||
 | 
			
		||||
  const aPREFS = [
 | 
			
		||||
    /* removed in arkenfox user.js */
 | 
			
		||||
    /* 52-alpha */
 | 
			
		||||
    'browser.search.reset.enabled',
 | 
			
		||||
@@ -240,29 +243,26 @@
 | 
			
		||||
    'security.ssl.enable_ocsp_stapling',
 | 
			
		||||
    /* reset parrot: check your open about:config after running the script */
 | 
			
		||||
    '_user.js.parrot'
 | 
			
		||||
  ]
 | 
			
		||||
  ];
 | 
			
		||||
 | 
			
		||||
  if("undefined" === typeof(Services)) {
 | 
			
		||||
    alert("about:config needs to be the active tab!");
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
  console.clear();
 | 
			
		||||
 | 
			
		||||
  let c = 0;
 | 
			
		||||
  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]);
 | 
			
		||||
  for (const sPname of aPREFS) {
 | 
			
		||||
    if (Services.prefs.prefHasUserValue(sPname)) {
 | 
			
		||||
      Services.prefs.clearUserPref(sPname);
 | 
			
		||||
      if (!Services.prefs.prefHasUserValue(sPname)) {
 | 
			
		||||
        console.info('reset', sPname);
 | 
			
		||||
        c++;
 | 
			
		||||
      } else { console.log("failed to reset", ops[i]); }
 | 
			
		||||
      } else console.warn('failed to reset', sPname);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  focus();
 | 
			
		||||
 | 
			
		||||
  let d = (c==1) ? " pref" : " prefs";
 | 
			
		||||
  if (c > 0) {
 | 
			
		||||
    alert("successfully reset " + c + d + "\n\nfor details check the Browser Console (Ctrl+Shift+J)");
 | 
			
		||||
  } else { alert("nothing to reset"); }
 | 
			
		||||
  const d = (c==1) ? ' pref' : ' prefs';
 | 
			
		||||
  alert(c ? 'successfully reset ' + c + d + "\n\nfor details check the console" : 'nothing to reset');
 | 
			
		||||
 | 
			
		||||
  return 'all done';
 | 
			
		||||
 | 
			
		||||
})();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user