BypassYoutubePub

Bypass youtube publicity Frensh Version

    // ==UserScript==
    // @name         BypassYoutubePub
    // @namespace    http://tampermonkey.net/
    // @version      2.1
    // @description  Bypass youtube publicity Frensh Version
    // @author       MeGaBOuSsOl
    // @match        https://www.youtube.com/*
    // @icon         https://www.google.com/s2/favicons?domain=youtube.com
    // @grant        God
    // ==/UserScript==

    var BypassYoutubePub5 = setInterval(function() {
    		if (document.body.outerHTML.indexOf("Ignorer l'annonce") !== -1) {
    			var BODY = document.body.outerHTML;
    			var Annonces = BODY.indexOf('Passer les annonces');
    			var First = (BODY.substring(Annonces, Annonces + 100));
    			var ClassBeg = First.indexOf('class="') + 7;
    			var Second = First.substring(ClassBeg, +200);
    			var classEnd = Second.indexOf('"');
    			console.log(Second.substring(0, classEnd));
    			document.getElementsByClassName('ytp-ad-skip-button-icon')[0].click();
    			clearInterval(BypassYoutubePub5);
    		}
    	},
    	1000);