您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fix for DeArrow blocking youtube's animated thumbnails on the watch page sidebar video list.
// ==UserScript== // @name DeArrow hack for sidebar animated thumbs compatibility - youtube.com // @namespace Violentmonkey Scripts seekhare // @match *://www.youtube.com/* // @run-at document-start // @version 1.0 // @license MIT // @author seekhare // @description Fix for DeArrow blocking youtube's animated thumbnails on the watch page sidebar video list. // ==/UserScript== const timoutDelayFixMs = 100; // milliseconds function setupMutationObserver() { console.log("Enabling: Fix DeArrow blocking youtube's animated thumbnails on the watch page sidebar video list.") const targetNode = document; const config = {attributes: true, childList: true, subtree: true}; const callback = (mutationList, observer) => { for (const mutation of mutationList) { for (const element of mutation.addedNodes) { if (element.nodeName === 'ANIMATED-THUMBNAIL-OVERLAY-VIEW-MODEL') { var imgtag = element.lastChild; setTimeout(() => { imgtag.classList.add('cbCustomThumbnailCanvas'); }, timoutDelayFixMs); //seems to need a delay to avoid class being overwritten by something in a race condition hence this setTimout hack. } else if (element.parentNode != null && element.parentNode.tagName === 'ANIMATED-THUMBNAIL-OVERLAY-VIEW-MODEL') { var imgtag = element; setTimeout(() => { imgtag.classList.add('cbCustomThumbnailCanvas'); }, timoutDelayFixMs); //seems to need a delay to avoid class being overwritten by something in a race condition hence this setTimout hack. } } } } const observer = new MutationObserver(callback); observer.observe(targetNode, config); } document.addEventListener("DOMContentLoaded", function(){ setupMutationObserver(); });