Skip to content

Instantly share code, notes, and snippets.

@llllvvuu
Last active August 28, 2024 07:04
Show Gist options
  • Save llllvvuu/62e29d4c0ff17df6ca3c6553a8a15d90 to your computer and use it in GitHub Desktop.
Save llllvvuu/62e29d4c0ff17df6ca3c6553a8a15d90 to your computer and use it in GitHub Desktop.
paste this into the console
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