您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Simple YouTube Adblock popup bypass
// ==UserScript== // @name YouTube Anti-Anti-Adblock 2024 // @version 1.0 // @description Simple YouTube Adblock popup bypass // @author daijro // @license MIT // @match *://*.youtube.com/watch* // @grant none // @run-at document-end // @namespace https://greasyfork.org/users/795282 // ==/UserScript== (function() { 'use strict'; const video = document.querySelector('video'); var oldPaused = video.paused; var pausedRecently = false; // Remove elements by selector and check if video is paused function handleElements(selector) { const elements = document.querySelectorAll(selector); if (elements.length > 0) { elements.forEach(el => el.remove()); console.log('Removed elements'); // Play the video if (video.paused && pausedRecently) { video.play(); console.log('Unpausing video'); } } } // Monitor DOM changes for popup const observer = new MutationObserver(mutations => { mutations.forEach(mutation => { if (!oldPaused && video.paused) { pausedRecently = true; setTimeout(() => { pausedRecently = false; }, 300); // reset after period } if (mutation.addedNodes.length) { handleElements('iron-a11y-announcer'); handleElements('tp-yt-paper-dialog'); } oldPaused = video.paused; }); }); const config = { childList: true, subtree: true }; observer.observe(document.body, config); })();