Last active
April 4, 2018 13:53
-
-
Save tcoppex/b3ae05eed8ebd67284e39ef1d48bc027 to your computer and use it in GitHub Desktop.
GreaseMonkey script to remove unused links from Youtube main page.
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 YouTube Spam Filters | |
// @namespace Youtube Scripts | |
// @description Remove unused links from Youtube's front page. | |
// @match *://www.youtube.com/* | |
// @grant GM_addStyle | |
// @run-at document-idle | |
// @icon http://www.youtube.com/favicon.ico | |
// ==/UserScript== | |
const links = [ "/feed/trending", "/feed/history", "/feed/purchases" ]; | |
links.forEach((link) => { | |
const href = `*[href="${link}"]`; | |
Array.prototype.forEach.call(document.querySelectorAll(href), (node) => { | |
node.parentNode.style.display = "none"; | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment