Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Delete YouTube Ad Containers
- // @namespace http://screwyoutube.com
- // @version 1.0
- // @description Delete youtube's Ad Containers so it can't load ads into videos or on the page.
- // @author Xyberviri
- // @include http*://*.youtube.com/*
- // @include http*://youtube.com/*
- // @include http*://*.youtu.be/*
- // @include http*://youtu.be/*
- // @run-at document-end
- // ==/UserScript==
- function DeleteAds() {
- if(window.location.href.indexOf("watch?v=") < 0){
- return false;
- } else {
- try {
- document.getElementById("google_companion_ad_div").remove();
- }
- catch(err) {}
- try {
- document.getElementById("player-ads").remove();
- }
- catch(err) {}
- try {
- document.getElementById("video-ads").remove();
- }
- catch(err) {}
- }
- };
- setInterval(DeleteAds(), 500);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement