Answers:
当前,尚无任何治疗/解决方法。除了逐个手动阻止它们之外,没有可伸缩的解决方案。
但是有些扩展可以这样做:
// ==UserScript==
// @version 1.1.1
// @name Hide watched videos on YouTube
// @namespace https://gist.github.com/xPaw/6324624
// @match https://www.youtube.com/*
// @updateURL https://gist.github.com/xPaw/6324624/raw/YoutubeHideWatched.user.js
// @downloadURL https://gist.github.com/xPaw/6324624/raw/YoutubeHideWatched.user.js
// @grant none
// ==/UserScript==
const app = document.querySelector( 'ytd-app' );
function HideVideos( a )
{
app.querySelectorAll( 'ytd-thumbnail-overlay-resume-playback-renderer:not([data-hidden="true"])' ).forEach( element =>
{
element.dataset.hidden = true;
while( ( element = element.parentNode ).tagName.toLowerCase() !== 'ytd-item-section-renderer' )
{
// Find the container element for this video
}
element.hidden = true;
} );
}
function ProcessPage()
{
if( !window.location.pathname.startsWith( '/feed/subscriptions' ) )
{
return;
}
const list = app.querySelector( 'ytd-section-list-renderer' );
if( list.dataset.hooked )
{
return;
}
list.dataset.hooked = true;
list.addEventListener( 'yt-next-continuation-data-updated', HideVideos );
// TODO: Find an event to fix this
new MutationObserver( HideVideos ).observe( list, { childList: true, subtree: true } );
}
app.addEventListener( 'yt-navigate-finish', ProcessPage );
ProcessPage();
AFAIK,无法在YouTube本身上执行此操作,但是我使用了Chrome扩展程序(YouTube更好的订阅),该扩展程序可让您从“订阅”标签中隐藏观看的视频。
display: none
在<ytd-compact-video-renderer>
包含子元素的任何元素上进行设置#progress
。您将无法在CSS中执行此操作,但是Tampermonkey脚本应该足够简单。我待会再去写答案...