您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Work in progress ad blocker utility (Ad Skipper)
// ==UserScript== // @name iYoutube Ad Blocker // @namespace http://tampermonkey.net/ // @version 2.1 // @description Work in progress ad blocker utility (Ad Skipper) // @author https://github.com/IrisV3rm // @match http://youtube.com/* // @match http://www.youtube.com/* // @match https://youtube.com/* // @match https://www.youtube.com/* // @icon https://www.youtube.com/favicon.ico // @grant none // @run-at document-end // @license MIT // ==/UserScript== (function() { 'use strict'; let reloading = false; function checkAndBlockAds() { if (document.getElementById("player-ads")){ document.getElementById("player-ads").remove(); } document.querySelectorAll('.yt-spec-button-shape-next__button-text-content').forEach(element =>{ if (element.innerText == "Allow YouTube Ads" && !reloading) { reloading = true; location.reload(); } }); document.querySelectorAll('.ytd-ad-slot-renderer').forEach(element => { element.remove(); }); //ytp-ad-skip-button-icon-modern document.querySelectorAll('.ytp-skip-ad-button').forEach(element => { if (element.innerText == "Skip"){ element.click(); } else if(element.innerText == "Skip Ad") { element.click(); } else if (element.innerText == "Skip Ads") { element.click(); } }); document.querySelectorAll('.ytp-button').forEach(element => { if (element.innerText == "Skip"){ element.click(); } else if(element.innerText == "Skip Ad") { element.click(); } else if (element.innerText == "Skip Ads") { element.click(); } }); document.querySelectorAll('.ytp-skip-ad-button').forEach(element => { try{ document.querySelectorAll('video')[0].currentTime = document.querySelectorAll('video')[0].duration; } catch{} }); } new MutationObserver(checkAndBlockAds).observe(document.body, { childList: true, subtree: true, attributes: true}); })();