This commit is contained in:
Dym Sohin 2024-01-12 14:36:56 +01:00 committed by GitHub
commit 46926fe789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 36 additions and 0 deletions

36
script.user.js Normal file
View File

@ -0,0 +1,36 @@
// ==UserScript==
// @name yt-hide-live
// @version 1.2
// @description Hide LIVE videos on YouTube's pages
// @author Wim Godden <wim@wimgodden.be>
// @author Dym Sohin <re@dym.sh>
// @match https://*.youtube.com/*
// @grant none
// @namespace https://greasyfork.org/users/48886
// @license CC0
// ==/UserScript==
(function() {
'use strict'
function removeLiveVideos(){
document
.querySelectorAll( `ytd-item-section-renderer` )
.forEach( e =>
{
is_live = e.querySelector( `.badge-style-type-live-now-alternate` )
if( is_live )
{
e.style.display = 'none'
}
})
}
const observer = new MutationObserver(removeLiveVideos)
observer.observe(
document.querySelector('#page-manager')
, { childList:true, subtree:true }
)
})()