-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtidy-youtube.js
59 lines (50 loc) · 2.03 KB
/
tidy-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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// ==UserScript==
// @name YouTube Hide recommended videos
// @description Hides the recommended videos on your stream (new design)
// @include *://youtube.com/*
// @include *://*.youtube.com/*
// @copyright 2022 iakovgan
// ==/UserScript==
// @inspiredBy https://greasyfork.org/scripts/4246-youtube-hide-recommended-videos
window.setTimeout(
function check() {
if (document.getElementsByClassName('shelf-title-annotation')) {
main();
}
window.setTimeout(check, 250);
}, 250
);
function main() {
var AggroText = "Все видео";
/*
If you need to add your language, add this block to "case" statement
and copy-paste text of "Popular channel you might like" span to it:
case TEXT_AT_BUTTON_IN_FOOTER_OF_MAIN_PAGE:
var AggroText = LOCALIZED_STRING_OF_"Popular channel you might like"
break;
*/
if (1) {
var TitleAnnotations = document.getElementsByClassName('yt-chip-cloud-chip-renderer');
for(var i = 0, len = TitleAnnotations.length; i < len; i++) {
if (TitleAnnotations[i].innerText == "Все видео") {
TitleAnnotations[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
}
};
};
if (1) {
var TitleAnnotations = document.getElementsByClassName('ytd-feed-filter-chip-bar-renderer');
for(var i = 0, len = TitleAnnotations.length; i < len; i++) {
if (TitleAnnotations[i].innerText == "Все") {
TitleAnnotations[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
}
}
}
if (1) {
var TitleAnnotations = document.getElementsByClassName('ytd-guide-entry-renderer');
for(var i = 0, len = TitleAnnotations.length; i < len; i++) {
if (TitleAnnotations[i].innerText != "Главная") {
TitleAnnotations[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.style.display = 'none';
}
}
}
} /* end of main() */