您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Skip YouTube ad without waiting for 5 sec
当前为
// ==UserScript== // @name YouTube Ad Skipper // @namespace http://tampermonkey.net/ // @version 0.1 // @description Skip YouTube ad without waiting for 5 sec // @author eggplants // @homepage https://github.com/eggplants // @match https://*.youtube.com/* // @grant none // @license MIT // ==/UserScript== function clickButton(elm){ //console.log('clicked'); if (elm){ elm.click(); } } function main(){ let adPreviewBtn = document.getElementsByClassName('ytp-ad-text ytp-ad-preview-text'); clickButton(adPreviewBtn[0]) let adSkipBtn = document.getElementsByClassName('ytp-ad-skip-button ytp-button'); clickButton(adSkipBtn[0]) let adFlowBtn = document.getElementsByClassName('ytp-ad-overlay-close-button'); clickButton(adFlowBtn[0]) } setInterval(main, 100);