Created
May 22, 2019 16:17
-
-
Save manhlinhng/174912014756b4f526e4fca450405b7a to your computer and use it in GitHub Desktop.
infinite_loop_youtube.js
This file contains 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
setInterval(function(){ | |
let btn_skip_ads = document.querySelector(".ytp-ad-skip-button.ytp-button"); | |
let btn_close_ads_overlay = document.querySelector(".ytp-ad-overlay-close-button"); | |
let btn_play = document.querySelector(".ytp-play-button.ytp-button"); | |
let title = btn_play.getAttribute('title'); | |
if(btn_skip_ads !== null){ | |
btn_skip_ads.click(); | |
} | |
if(btn_close_ads_overlay !== null){ | |
btn_close_ads_overlay.click(); | |
} | |
if(title == 'Replay'){ | |
btn_play.click(); | |
} | |
}, 500); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment