Greasy Fork is available in English.

YouTube Exponential Volume Slider

Makes the YouTube volume slider exponential so it's easier to select lower volumes.

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         YouTube Exponential Volume Slider
// @namespace    https://www.tampermonkey.net/
// @version      1.1.3
// @description  Makes the YouTube volume slider exponential so it's easier to select lower volumes.
// @author       Lukas Reinert
// @icon         https://www.youtube.com/img/favicon.ico
// @match        https://www.youtube.com/*
// @match        https://music.youtube.com/*
// @license      MIT
// @run-at       document-start
// @grant        none
// ==/UserScript==
 
(function() {
    'use strict';
 
    const EXPONENT = 2.5;
 
    const storedOriginalVolumes = new WeakMap();
    const {get, set} = Object.getOwnPropertyDescriptor(HTMLMediaElement.prototype, 'volume');
 
    Object.defineProperty(HTMLMediaElement.prototype, 'volume', {
        get() {
            const lowVolume = get.call(this);
            const storedOriginalVolume = storedOriginalVolumes.get(this);
            if (storedOriginalVolume !== undefined) return storedOriginalVolume;
            return Math.pow(lowVolume, 1 / EXPONENT);
        },
        set(originalVolume) {
            const adjustedVolume = Math.pow(originalVolume, EXPONENT);
            storedOriginalVolumes.set(this, originalVolume);
            set.call(this, adjustedVolume);
 
            console.log(`YouTube Volume: ${Math.round(originalVolume*100)}% (adjusted to ${(adjustedVolume * 100).toFixed(3)}%)`);
        }
    });
 
    // Ensure any videos already on the page get their volume adjusted
    const videos = document.getElementsByTagName('video');
    for (const video of videos) {
        if (!storedOriginalVolumes.has(video)) {
            const orig = video.volume;
            video.volume = orig; // triggers setter
        }
    }
 
})();