您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically enable audio playback on any videos
// ==UserScript== // @name Audio Autoplay for Everything // @namespace http://tampermonkey.net/ // @version 0.2 // @description Automatically enable audio playback on any videos // @author Leon Theremin // @match * // @grant none // ==/UserScript== (function() { 'use strict'; // Define a function to enable audio playback function enableAudio(video) { video.muted = false; } // Define a function to check for new videos and enable audio playback function checkForNewVideos() { // Get all video elements on the page const videos = document.getElementsByTagName('video'); // Loop through each video element and enable audio playback for (let i = 0; i < videos.length; i++) { // Check if the video has already been processed if (!videos[i].hasAttribute('data-audio-enabled')) { // Enable audio playback enableAudio(videos[i]); // Mark the video as processed videos[i].setAttribute('data-audio-enabled', true); } } } // Check for new videos every 500 milliseconds setInterval(checkForNewVideos, 500); })();