Skip to content

Instantly share code, notes, and snippets.

@vincent178
Created December 17, 2019 00:43
Show Gist options
  • Save vincent178/7094a97cd8f5dda3bd85229a913de874 to your computer and use it in GitHub Desktop.
Save vincent178/7094a97cd8f5dda3bd85229a913de874 to your computer and use it in GitHub Desktop.
// ==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