Skip to content

Instantly share code, notes, and snippets.

@ggmichaelgo
Created August 4, 2024 19:04
Show Gist options
  • Select an option

  • Save ggmichaelgo/a8bda52b3a216d10301c4eea5f88cf2c to your computer and use it in GitHub Desktop.

Select an option

Save ggmichaelgo/a8bda52b3a216d10301c4eea5f88cf2c to your computer and use it in GitHub Desktop.
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