Last active
October 2, 2021 14:08
-
-
Save Qofar/5cfbbe5e8880f337c3507f729593f39a to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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