Twitter - Uncheck All

Twitter - Uncheck All.

  1. // ==UserScript==
  2. // @name Twitter - Uncheck All
  3. // @description Twitter - Uncheck All.
  4. // @version 0.1
  5. // @author to
  6. // @namespace https://github.com/to
  7. // @license MIT
  8. //
  9. // @match https://twitter.com/settings/*
  10. // @icon https://www.google.com/s2/favicons?sz=64&domain=twitter.com
  11. //
  12. // @grant GM_registerMenuCommand
  13. // ==/UserScript==
  14.  
  15. const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
  16.  
  17. GM_registerMenuCommand('Uncheck All', () => {
  18. (async _ => {
  19. const inputs = Array.from(document.querySelectorAll('input[type="checkbox"]'));
  20. for (const i of inputs) {
  21. if (i.checked) {
  22. i.click();
  23. await sleep(1000);
  24. }
  25. }
  26. })();
  27. });