upd
This commit is contained in:
parent
9c6e9f9daf
commit
f6dd46f6d7
|
@ -0,0 +1,7 @@
|
|||
title "yt-hide-long"
|
||||
description "Hide LONG (over 2:00:00 – two hours) videos on YouTube's pages"
|
||||
media-type "userscript"
|
||||
tags "scripts" "js" "youtube"
|
||||
license "CC0"
|
||||
homepage "https://dym.sh/yt-hide-long/"
|
||||
source "https://source.garden/scripts/yt-hide-long/"
|
|
@ -0,0 +1,9 @@
|
|||
# yt-hide-long
|
||||
|
||||
> Hide LONG (over 2:00:00 – two hours) videos on YouTube's pages
|
||||
|
||||
## install
|
||||
|
||||
1. get [Tampermonkey](https://tampermonkey.net)
|
||||
2. visit https://source.garden/scripts/yt-hide-long/raw/branch/latest/script.user.js
|
||||
3. refresh the youtube page
|
|
@ -0,0 +1,13 @@
|
|||
// ==UserScript==
|
||||
// @name YouTube: Hide LONG Videos
|
||||
// @namespace https://source.garden
|
||||
// @version 1.0
|
||||
// @license CC0
|
||||
// @description Hide LONG (over 2:00:00 – two hours) videos on YouTube's pages
|
||||
// @author Dym Sohin <re@dym.sh>
|
||||
// @match https://*.youtube.com/*
|
||||
// @match https://youtube.com/*
|
||||
// @noframes
|
||||
// @downloadURL https://source.garden/scripts/yt-hide-long/raw/branch/latest/script.user.js
|
||||
// @updateURL https://source.garden/scripts/yt-hide-long/raw/branch/latest/script.meta.js
|
||||
// ==/UserScript==
|
|
@ -0,0 +1,37 @@
|
|||
// ==UserScript==
|
||||
// @name YouTube: Hide LONG Videos
|
||||
// @namespace https://source.garden
|
||||
// @version 1.0
|
||||
// @license CC0
|
||||
// @description Hide LONG (over 2:00:00 – two hours) videos on YouTube's pages
|
||||
// @author Dym Sohin <re@dym.sh>
|
||||
// @match https://*.youtube.com/*
|
||||
// @match https://youtube.com/*
|
||||
// @noframes
|
||||
// @downloadURL https://source.garden/scripts/yt-hide-long/raw/branch/latest/script.user.js
|
||||
// @updateURL https://source.garden/scripts/yt-hide-long/raw/branch/latest/script.meta.js
|
||||
// ==/UserScript==
|
||||
|
||||
(function() {
|
||||
'use strict'
|
||||
|
||||
function removeUpcomingVideos(){
|
||||
document
|
||||
.querySelectorAll( `ytd-item-section-renderer` )
|
||||
.forEach( e =>
|
||||
{
|
||||
const is_long = e.querySelector( `badge-shape[aria-label*="hours,"]` )
|
||||
if( is_long )
|
||||
{
|
||||
e.style.display = 'none'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const observer = new MutationObserver(removeUpcomingVideos)
|
||||
observer.observe(
|
||||
document.querySelector('#page-manager')
|
||||
, { childList:true, subtree:true }
|
||||
)
|
||||
|
||||
})()
|
Loading…
Reference in New Issue