JavaScript

JavaScript Bookmark to increase browser volume

I have had many times where I am streaming a video on some website, and the sound is very quiet (even with both my computer and video player’s settings set to max volume). To get around this, the following JavaScript code snippet can be added as a bookmark that works for most websites. (I’ve only had a couple it doesn’t work on).

javascript:(
function() {
    var videoElement =
document.querySelector("video");
var audioCtx = new AudioContext();
var source = audioCtx.createMediaElementSource(videoElement);
var gainNode = audioCtx.createGain();
gainNode.gain.value = 3; /* triple the volume */ source.connect(gainNode);
gainNode.connect(audioCtx.destination);
}
)();

Just create a new browser bookmark, and post this code for the bookmark’s URL.