Created
June 17, 2015 12:19
-
-
Save chibisov/71706c196042e3ae1193 to your computer and use it in GitHub Desktop.
Mute yandex radio advertisment
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
window.setInterval(function(){ | |
var volumeShouldBeOn = true; | |
var volumeIsOn = !Boolean($('.volume__icon_mute').length); | |
var isAdvShown = $('.slider__item_advert.slider__item_shown').length; | |
if (isAdvShown) { | |
volumeShouldBeOn = false; | |
} | |
if ((volumeShouldBeOn && !volumeIsOn) || (!volumeShouldBeOn && volumeIsOn)) { | |
$('.volume__btn').click(); | |
} | |
}, 100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment