Skip to content

Instantly share code, notes, and snippets.

@YellowOnion
Last active August 26, 2020 16:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save YellowOnion/727d53b497aac946f9e2b2e591a53f7a to your computer and use it in GitHub Desktop.
Suppresses audio to 1/8th it's power (Instagram, bandcamp, etc)
// ==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