Created
November 30, 2023 19:13
-
-
Save jwulf/c5baa7ae11209302615320200d8f82eb to your computer and use it in GitHub Desktop.
Remove the Camunda Community Hub Organization prefix from the GitHub Notifications list
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 Camunda Community Hub - remove moniker in GitHub Notifications | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove the 'camunda-community-hub/' organization from the notification title | |
// @author You | |
// @match https://github.com/notifications* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com | |
// @grant none | |
// ==/UserScript== | |
;(function() { | |
'use strict'; | |
const observer = new MutationObserver(mutations => { | |
mutations.forEach(mutation => { | |
if (mutation.addedNodes.length) { | |
document.querySelectorAll('div.js-notification-sidebar-repositories li a').forEach(aTag => { | |
Array.from(aTag.childNodes).forEach(node => { | |
if (node.nodeType === Node.TEXT_NODE) { | |
node.nodeValue = node.nodeValue.replace(/camunda-community-hub\//g, ''); | |
} | |
}); | |
}); | |
} | |
}); | |
}); | |
observer.observe(document.body, { childList: true, subtree: true }); | |
console.log('Executed Greasemonkey script to remove "camunda-community-hub/" from notifications') | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment