您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Keeps YouTube's video volume perfectly in sync with the volume slider, preventing YouTube from capping the volume below 100% even when the slider is maxed out.
// ==UserScript== // @name YouTube Volume Slider Fix // @namespace http://tampermonkey.net/ // @version 2.0 // @description Keeps YouTube's video volume perfectly in sync with the volume slider, preventing YouTube from capping the volume below 100% even when the slider is maxed out. // @author Zeridiant // @match *://www.youtube.com/* // @grant none // @license MIT // ==/UserScript== (function () { 'use strict'; let lastSliderValue = -1; function syncVolumeToSlider() { const video = document.querySelector('video'); const volumePanel = document.querySelector('.ytp-volume-panel[role="slider"]'); if (!video || !volumePanel) return; const sliderValueStr = volumePanel.getAttribute('aria-valuenow'); if (!sliderValueStr) return; const sliderValue = parseInt(sliderValueStr, 10); if (isNaN(sliderValue)) return; if (sliderValue !== lastSliderValue) { lastSliderValue = sliderValue; const newVolume = sliderValue / 100; if (video.volume !== newVolume) { video.volume = newVolume; console.log(`[OK] Slider: ${sliderValue} : Volume: ${newVolume.toFixed(2)}`); } } } setInterval(syncVolumeToSlider, 200); const observer = new MutationObserver(() => { if (!document.querySelector('video')) return; lastSliderValue = -1; }); observer.observe(document.body, { childList: true, subtree: true }); })();