Skip to content

Instantly share code, notes, and snippets.

@aaronlifton
Last active July 22, 2023 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronlifton/2f22ac3257c3fd78696c2aa08792e552 to your computer and use it in GitHub Desktop.
Save aaronlifton/2f22ac3257c3fd78696c2aa08792e552 to your computer and use it in GitHub Desktop.
unsubscribe from next-door emails
// https://nextdoor.com/settings/notification_prefs/
async function unsubscribe() {
matchingElementSet = document.evaluate("//span[text()='Email']/parent::div/following-sibling::input[contains(@aria-checked, 'true')]", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
for (let i = 0; i < matchingElementSet.snapshotLength; i++) {
await new Promise(r => setTimeout(r, 1000));
let currentEl = matchingElementSet.snapshotItem(i);
currentEl.click()
}
}
unsubscribe()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment