您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Prevent autoplayed featured videos on YouTube channel profile pages
当前为
// ==UserScript== // @name Prevent autoplayed featured videos on YouTube channel profiles // @namespace http://tampermonkey.net/ // @version 1.0 // @description Prevent autoplayed featured videos on YouTube channel profile pages // @author aspen138 // @match https://www.youtube.com/@*/featured // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; // Function to pause the video function pauseVideo() { const video = document.querySelector('video'); if (video && !video.paused) { video.pause(); console.log('YouTube autoplay video paused.'); } } // Create a MutationObserver to monitor for video elements const observer = new MutationObserver((mutations) => { pauseVideo(); }); // Start observing the document body for changes observer.observe(document.body, { childList: true, subtree: true }); // Attempt to pause the video immediately in case it's already there pauseVideo(); })();