Created
December 10, 2020 16:42
-
-
Save pyronaur/5649c6167904324f792b0c31d7ffa3b0 to your computer and use it in GitHub Desktop.
UserScript to Automatically clear GitHub CI Notifications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Clear CI Activity Notification | |
// @version 1.0.0 | |
// @grant none | |
// @match https://github.com/notifications | |
// ==/UserScript== | |
const notifications = document.querySelectorAll('.notifications-list-item') | |
const ciNotifications = Array.from(notifications).filter( (el) => { | |
return el.querySelector('div > div > span').innerText === "ci activity" | |
}, []) | |
if( ciNotifications.length === 0 ) { | |
return; | |
} | |
ciNotifications.forEach( (el) => { | |
el.querySelector('input[type=checkbox]').click() | |
}) | |
setTimeout( () => { | |
document.querySelector('button[title="Done"]').click() | |
}, 200) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment