YouTube - Ad Skip

Skips ads automatically

目前为 2018-04-02 提交的版本。查看 最新版本

// ==UserScript==
// @name         YouTube - Ad Skip
// @version      1.0
// @description  Skips ads automatically
// @author       Bobocato
// @match        https://www.youtube.com/*
// @grant        none
// @namespace https://gf.qytechs.cn/users/167089
// ==/UserScript==

const equalText = "Überspringen";

function skipAd(){
    console.log("Tried to skip a ad");
    if(document.getElementsByClassName("videoAdUiSkipButton").length > 0){
        if(document.getElementsByClassName("videoAdUiSkipButton")[0].childNodes[0].textContent === equalText){
            document.getElementsByClassName("videoAdUiSkipButton")[0].click();
        } else {
            setTimeout(skipAd(), 1000);
        }
    }
}

(function() {
    'use strict';
    setInterval(function (){
        if(window.location.href.substring(0,30) == "https://www.youtube.com/watch?"){
            skipAd();
        }
    }, 2500);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址