您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically unmutes YouTube videos on page load if muted based, but after full page load
// ==UserScript== // @name Unmute YouTube Video if muted on page load // @namespace Violentmonkey Scripts // @version 0.2 // @description Automatically unmutes YouTube videos on page load if muted based, but after full page load // @author ChatGPT lmao // @match https://www.youtube.com/* // @grant none // @run-at document-start // Execute as soon as possible when the document starts loading // @license WTF // ==/UserScript== (function() { 'use strict'; // // Dear lord this whole thing was written by ChatGPT, just why // // Function to check if the video is muted based on the .muted class and unmute it function unmuteVideo() { const muteButton = document.querySelector('.ytp-mute-button'); // The mute button const video = document.querySelector('video'); if (video.muted || muteButton) { muteButton.click(); // Toggle the mute button to unmute console.log('Video was muted, unmuting...'); if (video.muted){video.muted=false;} } } // Create a MutationObserver to watch for changes in the document body const observer = new MutationObserver((mutationsList, observer) => { // Check if the mute button is added to the DOM const muteButton = document.querySelector('.ytp-mute-button'); if (muteButton) { // Once we find the mute button, we can unmute the video after the page is fully loaded window.addEventListener('load', () => { unmuteVideo(); // Stop observing once we've executed the action observer.disconnect(); }); } }); // Start observing the document body for child nodes being added (new elements) observer.observe(document.body, { childList: true, subtree: true }); // Initial check for the mute button and video on page load, if available window.addEventListener('load', () => { unmuteVideo(); setTimeout(unmuteVideo,2000); }); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址