Skip to content

Instantly share code, notes, and snippets.

@KevCui
Last active June 20, 2021 09:01
Show Gist options
  • Save KevCui/079067d5606a04d069ca06e34ece164f to your computer and use it in GitHub Desktop.
Save KevCui/079067d5606a04d069ca06e34ece164f to your computer and use it in GitHub Desktop.
Hide release activity on personal GitHub dashboard
// ==UserScript==
// @name Github Hide Release Info
// @description Hide relaese activity on personal GitHub dashboard
// @author KevCui
// @match https://github.com/
// @grant none
// ==/UserScript==
function hideReleaseInfo() {
var elems = document.getElementsByClassName('release');
Array.prototype.forEach.call(elems, function(elm) {
elm.style.display = "none";
});
}
function observeDashboard() {
var targetNode = document.getElementById('dashboard');
var config = { attributes: false, childList: true, subtree: true };
var callback = function(mutationsList, observer) {
for(var mutation of mutationsList) {
if (mutation.type === 'childList') {
hideReleaseInfo();
}
}
};
var observer = new MutationObserver(callback);
observer.observe(targetNode, config);
}
window.addEventListener('load', function() {
observeDashboard();
}, false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment