Skip to content

Instantly share code, notes, and snippets.

@RayBB
Last active August 20, 2019 21:51
Show Gist options
  • Save RayBB/43450af4d8ed4a0a996306d5c6641e70 to your computer and use it in GitHub Desktop.
Save RayBB/43450af4d8ed4a0a996306d5c6641e70 to your computer and use it in GitHub Desktop.
Automatically clicks the show new messages button for unread tab in slack
// Works on pages such as: https://app.slack.com/client/*********/unreads/
/*
Basically just clicks the "X New Messages" button when it pops up :)
*/
setInterval(function(){
let newMessageButton = [...document.querySelectorAll('button')]
.filter(txt => txt.innerHTML.toLowerCase()
.includes('new message'))[0]
if (newMessageButton != null) {
newMessageButton.click();
}
}, 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment