Skip to content

Instantly share code, notes, and snippets.

@Qofar
Last active October 2, 2021 14:08
Show Gist options
  • Save Qofar/5cfbbe5e8880f337c3507f729593f39a to your computer and use it in GitHub Desktop.
Save Qofar/5cfbbe5e8880f337c3507f729593f39a to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Twitch - Mute ads
// @include https://www.twitch.tv/*
// @version 1.0
// @license MIT
// @grant none
// ==/UserScript==
(() => {
window.setInterval(() => {
let ads = document.querySelector('div[data-test-selector="sad-overlay"]');
let muted = document.querySelector('video').muted;
if(ads) {
if(muted === false) {
document.querySelector('video').muted = true;
}
} else {
if(muted === true) {
document.querySelector('video').muted = false;
}
}
}, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment