Last active
August 26, 2020 16:57
Star
You must be signed in to star a gist
Suppresses audio to 1/8th it's power (Instagram, bandcamp, etc)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Instagram audio supression. | |
// @namespace http://tampermonkey.net/ | |
// @version 0.3 | |
// @description Suppresses audio to 1/8th it's power | |
// @author YellowOnion | |
// @match https://*.instagram.com/* | |
// @require https://code.jquery.com/jquery-3.5.1.slim.min.js | |
// @updateURL https://gist.github.com/YellowOnion/727d53b497aac946f9e2b2e591a53f7a/raw/supnoise.user.js | |
// @grant none | |
// ==/UserScript== | |
var vol = 0.125; | |
var MO = new MutationObserver( function (mutations) { | |
mutations.forEach ( function (mutation) { | |
mutation.addedNodes.forEach ( function(node) { | |
jQuery('video', node).prop("volume", vol ); | |
jQuery('audio', node).prop("volume", vol ); | |
}); | |
}); | |
}); | |
MO.observe(document, {childList: true, subtree: true}); | |
setTimeout( function () { | |
jQuery('video').prop("volume", vol ); | |
jQuery('audio').prop("volume", vol ); | |
}, 2000); | |
console.log("AUDIO SUPRESSSSSSS"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment