YouTube Ad Auto Report

This Script is going to check for ad on YouTube every 200ms and if it find's one it will automatically report it which results in successfully skipping it. (NOT WORKING WITH AD PERSONALISATION TURNED OFF!!!)

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         YouTube Ad Auto Report
// @namespace    http://tampermonkey.net/
// @version      1.1
// @description  This Script is going to check for ad on YouTube every 200ms and if it find's one it will automatically report it which results in successfully skipping it. (NOT WORKING WITH AD PERSONALISATION TURNED OFF!!!)
// @author       You
// @include      http://www.youtube.com/watch*
// @include      https://www.youtube.com/watch*
// @include      youtube.com/watch*
// @include      http://www.youtube.com/*
// @include      https://www.youtube.com*
// @include      youtube.com/*
// @icon         https://www.google.com/s2/favicons?domain=youtube.com
// @grant        none
// ==/UserScript==

function sleep(ms) {
    return new Promise((resolve) => {
        setTimeout(resolve, ms);
    });
}

function skipAds() {
    if (document.getElementsByClassName("ytp-ad-overlay-close-button").length != 0){
        document.getElementsByClassName("ytp-ad-overlay-close-button")[0].click();
    }
    if (document.getElementsByClassName("ytp-ad-button ytp-ad-button-link ytp-ad-clickable").length != 0) {
        document.getElementsByClassName("ytp-ad-button ytp-ad-button-link ytp-ad-clickable")[0].click();
        sleep(50);
        document.getElementsByClassName("ytp-ad-button ytp-ad-info-dialog-mute-button ytp-ad-button-link")[0].click();
        sleep(50);
        document.getElementsByClassName("ytp-ad-feedback-dialog-reason-input")[0].click();
        sleep(50);
        document.getElementsByClassName("ytp-ad-feedback-dialog-confirm-button")[0].click();
        console.log("SkippedAd");
    }
}


var start = function() {
    setInterval(function () {
        skipAds();
    }, 200);
}
document.onload = start();