Created
August 4, 2024 19:04
-
-
Save ggmichaelgo/a8bda52b3a216d10301c4eea5f88cf2c to your computer and use it in GitHub Desktop.
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
| const removeEyeSores = function () { | |
| const list = document.querySelectorAll( | |
| ".ytd-reel-shelf-renderer > span, .ytd-shelf-renderer > span, .ytd-rich-shelf-renderer > span" | |
| ); | |
| const filterList = [ | |
| "Channels new to you", | |
| "For you", | |
| "People also watched", | |
| "Shorts" | |
| ]; | |
| list.forEach((e) => { | |
| if (filterList.includes(e.innerHTML)) { | |
| var parent = e.parentNode; | |
| while ( | |
| parent.className.includes("ytd-item-section-renderer") == false && | |
| parent.className.includes("ytd-rich-grid-renderer") == false && | |
| parent | |
| ) { | |
| parent = parent.parentNode; | |
| if (parent.nodeName == "H2") { | |
| parent = parent.parentNode; | |
| } | |
| } | |
| if (parent) { | |
| parent.style.display = "none"; | |
| } | |
| } | |
| }); | |
| } | |
| window.onload = function () { | |
| setTimeout(removeEyeSores, 100); | |
| window.eyeSoreTimer = setInterval(removeEyeSores, 1000); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment