Skip to content

Instantly share code, notes, and snippets.

@Ayc0
Last active August 7, 2019 18:58
Show Gist options
  • Save Ayc0/07bf770789121422de9c333bedaeab4d to your computer and use it in GitHub Desktop.
Save Ayc0/07bf770789121422de9c333bedaeab4d to your computer and use it in GitHub Desktop.
Mark as read every merged or closed notifications
Array.from(document.querySelectorAll('.unread'))
.filter(
el =>
el.querySelector('.type-icon-state-merged') ||
el.querySelector('.type-icon-state-closed') ||
el.classList.contains('security-alert-notification')
)
.map(el => el.querySelector('button[type="submit"]'))
.forEach(el => el.click());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment