-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathintentional-youtube.js
38 lines (38 loc) · 1.25 KB
/
intentional-youtube.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
(function () {
const deleteStuffOnPage = function () {
const thingsToGetOuttaHere = [
"secondary", // Video sidebar, 'prolly other things too.
"related", // Related videos.
"chips", // The recommended video topics on homepage & elsewhere.
"comments", // Seemingly broken by the above, but this removes your face. Nice.
];
const onHomepage = window.location.pathname == "/";
if (onHomepage) {
thingsToGetOuttaHere.push("primary"); // The big video suggestion grid.
}
for (const id of thingsToGetOuttaHere) {
const elem = document.getElementById(id);
if (elem) {
elem.replaceWith(""); // Get outta here.
}
}
const classesCancelled = [
"ytp-endscreen-content", // Recommend videos that show up in the video player
];
for (const klass of classesCancelled) {
const elems = document.getElementsByClassName(klass);
for (const elem of elems) {
elem.replaceWith(""); // It's a snow day after all.
}
}
};
const observer = new MutationObserver(function (_mutationsList, _observer) {
deleteStuffOnPage();
});
// Tell me -EVERYTHING-.
observer.observe(document.body, {
attributes: false,
childList: true,
subtree: true,
});
})();