-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyoutube-search-results-cleanup.js
41 lines (38 loc) · 1.48 KB
/
youtube-search-results-cleanup.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
// ==UserScript==
// @name YouTube Search Results CleanUp
// @icon https://i.postimg.cc/mg5spQGd/yt-search-cleanup-logo-64x.png
// @namespace adtitas
// @version 1.0.0
// @description Refine search results by removing unrelated content such as 'People also watched', 'For you' & 'Reels' ensuring a focused and relevant video search experience.
// @include http://youtube.com/*
// @include https://youtube.com/*
// @include http://*.youtube.com/*
// @include https://*.youtube.com/*
// @grant none
// @author adtitas
// @license MIT
// ==/UserScript==
(function() {
let styleNode = document.createElement("style");
styleNode.appendChild(document.createTextNode(`
.ytd-search ytd-shelf-renderer,
.ytd-search ytd-reel-shelf-renderer,
.ytd-search ytd-horizontal-card-list-renderer,
.ytd-search ytd-search-pyv-renderer,
#spinner-container {
display: none !important;
}
.ytd-search:hover .ytd-shelf-renderer,
.ytd-search:hover .ytd-reel-shelf-renderer,
.ytd-search:hover .ytd-horizontal-card-list-renderer,
.ytd-search ytd-search-pyv-renderer,
.ytd-search:hover #spinner-container {
display: block !important;
}
`));
(document.querySelector("head") || document.documentElement).appendChild(styleNode);
let spinnerContainer = document.getElementById("spinner-container");
if (spinnerContainer) {
spinnerContainer.parentNode.removeChild(spinnerContainer);
}
})();