GitHub notifications are overwhelming in large organizations with 100+ repositories.
目前為
// ==UserScript==
// @name No more GitHub notifications
// @namespace http://tampermonkey.net/
// @version 2025-03-21
// @description GitHub notifications are overwhelming in large organizations with 100+ repositories.
// @author mxt-mischa
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant window.onurlchange
// @license AGPL-3.0
// ==/UserScript==
(function() {
'use strict';
function queryElement(selector) {
return new Promise((resolve) => {
const element = document.querySelector(selector);
if (element) {
resolve(element);
return;
}
const observer = new MutationObserver(() => {
const newElement = document.querySelector(selector);
if (newElement) {
observer.disconnect();
resolve(newElement);
}
});
observer.observe(document.body, {
childList: true,
subtree: true,
});
});
}
async function main() {
const indicator = await queryElement(`notification-indicator`);
if (indicator) {
indicator.remove();
} else {
alert("Notifications where?");
}
}
window.addEventListener("urlchange", main);
main();
})();