您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Mutes / unmutes a Twitch video by clicking the middle mouse button within the video player. While performing the middle mouse button click, the scroll button gets disabled. Mute / unmute / scroll disabling won't work with any elements floating over the video player.
当前为
// ==UserScript== // @name Twitch Middle Mouse Button Mute / Unmute // @author NWP // @description Mutes / unmutes a Twitch video by clicking the middle mouse button within the video player. While performing the middle mouse button click, the scroll button gets disabled. Mute / unmute / scroll disabling won't work with any elements floating over the video player. // @namespace https://gf.qytechs.cn/users/877912 // @version 0.1 // @license MIT // @match *://*.twitch.tv/* // @run-at document-start // @grant none // ==/UserScript== (function() { // div[data... is for when the controls are visible, video is for when the controls are hidden // due to https://gf.qytechs.cn/en/scripts/501592-auto-hide-video-controls-almost-instantly-really-quickly-for-the-twitch-desktop-and-mobile-site // being enabled // // Normally, only div[data... is needed const videoArea = "div[data-a-target='player-overlay-click-handler'], video"; const muteButton = "button[data-a-target='player-mute-unmute-button']"; function handleMiddleMouseButtonDown(event) { if (event.button === 1 && event.target.closest(videoArea)) { event.preventDefault(); const button = document.querySelector(muteButton); if (button) { button.click(); } } } function addEventListenersToVideos() { const videos = document.querySelectorAll(videoArea); videos.forEach((video) => { video.removeEventListener('mousedown', handleMiddleMouseButtonDown); video.addEventListener('mousedown', handleMiddleMouseButtonDown); }); } const observer = new MutationObserver((mutationsList) => { for (const mutation of mutationsList) { if (mutation.type === 'childList' && mutation.addedNodes.length) { mutation.addedNodes.forEach((node) => { if (node.nodeType === 1) { if (node.matches(videoArea) || node.querySelector(videoArea)) { addEventListenersToVideos(); } } }); } } }); observer.observe(document.body, { childList: true, subtree: true }); addEventListenersToVideos(); })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址