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

Install steps: Install a userscript manager, select Install, then open a website matched by the script.

بەکارهێنەرانی سەرەتایی HOWTO 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

دژە تایبەتمەندی: دیاری نەکراوە

Source and freshness

The following figures come from the original source and are separate from activity on this site.

Original script: YouTube Ads-Bypass + Premium Logo (Ultra Light)

Source version: 1.29.0

Last source check:

Last successful check:

Source daily installs
0
Source total installs
0
OpenUserJS install requests
0

Requests received by this site are not proof that a user completed installation.

Clicking Install records a request on this site; it does not confirm installation. Not working after install? View troubleshooting and issues

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