Skip to content

Instantly share code, notes, and snippets.

@Sneezry
Created April 8, 2024 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sneezry/27733d010ca44e9fa106c1401b4bfc05 to your computer and use it in GitHub Desktop.
Save Sneezry/27733d010ca44e9fa106c1401b4bfc05 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name YouTube 音量加倍
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.youtube.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
const videoList = document.getElementsByTagName('video');
for (var v of videoList) {
// create an audio context and hook up the video element as the source
let audioCtx = new AudioContext();
let source = audioCtx.createMediaElementSource(v);
// create a gain node
let gainNode = audioCtx.createGain();
gainNode.gain.value = 10;
source.connect(gainNode);
// connect the gain node to an output destination
gainNode.connect(audioCtx.destination);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment