您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Sets the volume of the video player on Twitch's clip creation page to the stored value, same as how the clip playback page
当前为
// ==UserScript== // @name Twitch Clip Creation Volume // @description Sets the volume of the video player on Twitch's clip creation page to the stored value, same as how the clip playback page // @namespace vaindil // @version 1.0.1 // @author vaindil // @include https://clips.twitch.tv/create // @include https://clips.twitch.tv/*/edit // @grant none // ==/UserScript== console.warn('yep memes'); const obs = new MutationObserver((mutations, me) => { const slider = document.querySelector('[id^="player-volume-slider"]'); if (slider == null) { return; } let volume = localStorage.getItem('volume'); volume = volume ? volume : '0.5'; setNativeValue(slider, volume); slider.dispatchEvent(new Event('input', { bubbles: true })); obs.disconnect(); }); obs.observe(document, { childList: true, subtree: true }); function setNativeValue(element, value) { const valueSetter = Object.getOwnPropertyDescriptor(element, 'value').set; const prototype = Object.getPrototypeOf(element); const prototypeValueSetter = Object.getOwnPropertyDescriptor(prototype, 'value').set; if (valueSetter && valueSetter !== prototypeValueSetter) { prototypeValueSetter.call(element, value); } else { valueSetter.call(element, value); } }