Last active
June 20, 2021 09:01
-
-
Save KevCui/079067d5606a04d069ca06e34ece164f to your computer and use it in GitHub Desktop.
Hide release activity on personal GitHub dashboard
This file contains hidden or 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 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