max / YouTube Ads-Bypass + Premium Logo (Ultra Light)

安装步骤: 先安装脚本管理器,再点“安装”,最后打开脚本适用的网站。

用户脚本新手指南 Chrome Edge Firefox

发布时间:

版本: 2.2.12.1+ec1d96d

摘要: Ultra-lightweight event-driven script to bypass ads, block warning popups, and inject Premium logo. Zero polling, 0% idle CPU.

许可证: MIT

反功能: 未说明

脚本来源与更新状态

以下数据来自原始来源,与本站收到的安装请求分开统计。

原始脚本: YouTube Ads-Bypass + Premium Logo (Ultra Light)

来源版本: 1.29.0

最近来源检查:

最近成功检查:

来源站日安装量
0
来源站总安装量
0
本站安装请求
0

本站收到的请求不代表用户已完成安装。

点击安装只表示本站收到安装请求,不代表安装已完成。 安装后无法使用?查看问题反馈与排查

YouTube Ads-Bypass + Premium Logo (Ultra Light)

A high-performance, ultra-lightweight, and event-driven Tampermonkey script designed to bypass all YouTube video ads, completely block adblock warning popups, and inject the official YouTube Premium logo for both light and dark modes. Built with 0% idle CPU usage and zero polling loops (no setIntervals).

Key Features

  • Zero-Polling Architecture (0% Idle CPU): Unlike conventional scripts that run heavy setInterval loops constantly, this script is fully event-driven, utilizing native modern APIs like MutationObserver.
  • IntersectionObserver Spoofing (Anti-Adblock Defeat): Bypasses YouTube's aggressive anti-adblock detection by proxying the visibility check of the dialog elements. YouTube's backend scripts think the warning dialog is fully visible (isIntersecting: true), while it is actually completely hidden and disabled.
  • Intelligent Ad Skipping: When an ad is detected, the script instantly mutes the video, accelerates the playback speed to 2.0x, and seeks directly to the last 0.1s of the ad to avoid triggering ad blocker detectors.
  • Premium Logo Injection: Seamlessly replaces the standard YouTube logo with the official vector-based SVG YouTube Premium logo, dynamically adjusting to both light and dark (dark) themes.
  • Instant CSS Injection: Injects highly specific CSS rules onto document.documentElement at document-start to hide known ad elements, overlays, and warnings immediately, preventing any visual flickering or layout shifts.
  • SPA (Single Page Application) Navigation Support: Hooks into the yt-navigate-finish event to ensure the script remains active and re-initializes correctly across in-page transitions.

How It Works

  1. IntersectionObserver Spoofing: The script creates a Proxy wrapper around the browser's native IntersectionObserver. If the target element is an anti-adblock dialog (YTD-ENFORCEMENT-MESSAGE-VIEW-MODEL, TP-YT-PAPER-DIALOG, etc.), the observer returns isIntersecting: true and intersectionRatio: 1.
  2. DOM & Popup Monitoring: A global MutationObserver watches for newly added elements in the DOM. Once the warning popup is detected, it automatically clicks the dismiss button, clears the warning container contents to prevent memory leaks, and triggers the play button to resume the video.
  3. Player Class Detection: The script monitors class name changes on the #movie_player element for .ad-showing or .ad-interrupting classes. Once detected, the skip actions are instantly executed.

Installation Instructions

Prerequisites

Make sure you have a UserScript manager extension installed in your browser:

  • Tampermonkey (Highly Recommended)
  • Violentmonkey

Step-by-Step

  1. Open your Tampermonkey Dashboard.
  2. Click the + (Add) icon to create a new script.
  3. Delete all default template code inside the editor.
  4. Copy the complete code from ads.js (or adsMinify.js for the minified version).
  5. Paste it into the Tampermonkey editor.
  6. Save the script (Ctrl + S or File -> Save).
  7. Open or refresh YouTube to enjoy an ad-free experience!

Developer Guide

If you make modifications to the source code in ads.js, you can minify the script offline by running:

node minify.js

This will automatically process your changes and generate/update the optimized adsMinify.js file (compressed down to ~12KB).

评分: 0