您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
Makes the YouTube music volume slider exponential so it's easier to select lower volumes.
当前为
// ==UserScript== // @name Youtube Music fix volume ratio // @namespace http://tampermonkey.net/ // @version 0.1 // @description Makes the YouTube music volume slider exponential so it's easier to select lower volumes. // @author Marco Pfeiffer <[email protected]> // @match https://music.youtube.com/* // @grant none // ==/UserScript== (function() { 'use strict'; const player = document.querySelector('ytmusic-player-bar'); if (!player) { console.error("I failed you"); } function manipulate () { const setVolume = player.playerApi_.setVolume; // if the player isn't ready yet try again if (!setVolume) { console.log("player wasn't ready, try again"); setTimeout(manipulate, 10); return; } player.playerApi_.setVolume = function (volume) { const newVolume = (volume / 100) ** 2 * 100; console.log('manipulated volume', volume, newVolume); return setVolume.call(this, newVolume); }; } manipulate(); })();