Last active
August 28, 2024 07:04
-
-
Save llllvvuu/62e29d4c0ff17df6ca3c6553a8a15d90 to your computer and use it in GitHub Desktop.
paste this into the console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async function uncheckAllWithDelay() { | |
const checkboxes = document.querySelectorAll('input[type="checkbox"], [role="checkbox"]'); | |
for (let i = 0; i < checkboxes.length; i++) { | |
const checkbox = checkboxes[i]; | |
if (checkbox.checked || checkbox.getAttribute('aria-checked') === 'true') { | |
const clickEvent = new MouseEvent('click', { | |
view: window, | |
bubbles: true, | |
cancelable: true | |
}); | |
checkbox.dispatchEvent(clickEvent); | |
console.log(`Processed checkbox ${i + 1} of ${checkboxes.length}`); | |
await new Promise(resolve => setTimeout(resolve, 100)); | |
} | |
} | |
console.log('Finished processing all checkboxes'); | |
} | |
uncheckAllWithDelay(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment