Created
December 17, 2019 00:43
-
-
Save vincent178/7094a97cd8f5dda3bd85229a913de874 to your computer and use it in GitHub Desktop.
This file contains 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 Github Unsubscribe | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description Unsubscribe merged or closed threads! | |
// @author You | |
// @match https://github.com/notifications | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
let reload = false; | |
document.querySelectorAll('.list-group-item.unread').forEach(item => { | |
if (item.querySelector('.type-icon-state-closed, .type-icon-state-merged')) { | |
reload = true; | |
item.querySelector('.btn-link.mute-note').click(); | |
} | |
}) | |
if (reload) { | |
location.reload() | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment