We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I wrote a simple script to just skip ads. It's not optimized but it works:
setInterval(() => { if(document.getElementsByClassName("ytp-ad-text").length > 0) { const video = document.getElementsByClassName("video-stream html5-main-video")[0]; video.play(); video.pause(); video.currentTime = video.duration; } }, 500);
I use the plugin called Custom JavaScript for Websites 2 to execute this script every time I visit youtube.
The text was updated successfully, but these errors were encountered:
It's not perfect, but it works ;p Thanks @dennisfrijlink
Sorry, something went wrong.
It's very useful, thank you!!
Some issues fixed and added automatic click on overlay close button with this:
function hideAds() { if(document.getElementsByClassName("ytp-ad-text").length > 0) { const video = document.getElementsByClassName("video-stream html5-main-video")[0]; video.play(); video.pause(); video.currentTime = video.duration; const video1 = document.getElementsByClassName("video-stream html5-main-video")[1]; video1.play(); video1.pause(); video1.currentTime = video1.duration; } if(document.getElementsByClassName("ytp-ad-overlay-close-button").length > 0) { document.getElementsByClassName("ytp-ad-overlay-close-button")[0].click(); document.getElementsByClassName("ytp-ad-overlay-close-button")[1].click(); } } window.setInterval(hideAds, 500);
No branches or pull requests
I wrote a simple script to just skip ads. It's not optimized but it works:
I use the plugin called Custom JavaScript for Websites 2 to execute this script every time I visit youtube.
The text was updated successfully, but these errors were encountered: