Skip to content

Instantly share code, notes, and snippets.

@chibisov
Created June 17, 2015 12:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chibisov/71706c196042e3ae1193 to your computer and use it in GitHub Desktop.
Save chibisov/71706c196042e3ae1193 to your computer and use it in GitHub Desktop.
Mute yandex radio advertisment
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