This content originally appeared on DEV Community and was authored by CristoferK
Hello! Are you tired of watching youtube ads? Why not make your own adblocker for free!
Let's start!
setInterval(function(){
var skipButton = document.getElementsByClassName("ytp-ad-skip-button");
if(skipButton != undefined && skipButton.length > 0) {
console.log("Ad detected");
skipButton[0].click();
}
}, 3000)
{
"manifest_version": 2,
"name": "Youtube Ad Skiper",
"description": "This extension will help you to watch your favorite videos, without the intervention of Advertisements!",
"version": "1.0",
"author": "CristoferK",
"icons":{
"600":"logo.png"
},
"browser_action":{
"default_popup":"popup.html"
},
"content_scripts": [{
"js": ["script.js"],
"run_at": "document_idle",
"matches": ["<all_urls>"]
}],
"permissions": [
"tabs",
"activeTab"
]
}
Don't forget to subscribe to my YouTube channel for programming tutorials: https://www.youtube.com/channel/UCFzeA3xC-_i4ZT-XwcwsJxQ
This content originally appeared on DEV Community and was authored by CristoferK
CristoferK | Sciencx (2021-04-10T10:14:05+00:00) Make your own YouTube AdBlocker for FREE!. Retrieved from https://www.scien.cx/2021/04/10/make-your-own-youtube-adblocker-for-free/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.