Skip to content

Instantly share code, notes, and snippets.

@AndersMoberg
Last active August 7, 2022 13:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndersMoberg/f3b8ae61c7662f3d282d158325aa8fdc to your computer and use it in GitHub Desktop.
Save AndersMoberg/f3b8ae61c7662f3d282d158325aa8fdc to your computer and use it in GitHub Desktop.
Uncheck all "notification" boxes in Patreon settings page (run in browser dev tools - https://www.patreon.com/settings/email)
result = document.querySelectorAll("button[aria-checked=true]")
const mouseClickEvents = ['mousedown', 'click', 'mouseup'];
function simulateMouseClick(element){
element.scrollIntoView();
mouseClickEvents.forEach(mouseEventType =>
element.dispatchEvent(
new MouseEvent(mouseEventType, {
view: window,
bubbles: true,
cancelable: true,
buttons: 1
})
)
);
}
result.forEach((element, index) => setTimeout(() => {simulateMouseClick(element)} ,index * 5000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment