-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.user.js
37 lines (33 loc) · 980 Bytes
/
script.user.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
// ==UserScript==
// @name YouTube: Hide UPCOMING Videos
// @namespace https://source.garden
// @version 1.1
// @license CC0
// @description Hide UPCOMING videos on YouTube's pages
// @author Dym Sohin <[email protected]>
// @match https://youtube.com/*
// @match https://*.youtube.com/*
// @noframes
// @downloadURL https://source.garden/scripts/yt-hide-upcoming/raw/branch/latest/script.user.js
// @updateURL https://source.garden/scripts/yt-hide-upcoming/raw/branch/latest/script.meta.js
// ==/UserScript==
(function() {
'use strict'
function removeUpcomingVideos(){
document
.querySelectorAll( `ytd-item-section-renderer` )
.forEach( e =>
{
const is_upcoming = e.querySelector( `badge-shape[aria-label="Upcoming"]` )
if( is_upcoming )
{
e.style.display = 'none'
}
})
}
const observer = new MutationObserver(removeUpcomingVideos)
observer.observe(
document.querySelector('#page-manager')
, { childList:true, subtree:true }
)
})()