您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically unmutes YouTube videos when they load
// ==UserScript== // @name Auto Unmute YouTube Videos // @namespace http://tampermonkey.net/ // @version 0.2 // @description Automatically unmutes YouTube videos when they load // @author Starzee // @match https://www.youtube.com/* // @grant none // ==/UserScript== (function() { 'use strict'; // Function to unmute the video function unmuteVideo() { const video = document.querySelector('video'); if (video && video.muted) { video.muted = false; } } // Listen for changes in the page to catch dynamically loaded content const observer = new MutationObserver((mutationsList) => { for (const mutation of mutationsList) { if (mutation.type === 'childList') { unmuteVideo(); } } }); // Start observing for changes in the DOM observer.observe(document.body, { childList: true, subtree: true }); // Also, try unmuting the video when the page is loaded window.addEventListener('load', unmuteVideo); // Attempt to unmute video periodically in case it loads after a delay setInterval(unmuteVideo, 1000); })();