Urgent.News

What's breaking now, across hundreds of outlets.

Tech

YouTube Ad Punisher – Bypass anti-adblock

YouTube Ad Punisher is a browser extension designed to bypass YouTube's anti-adblock system and automatically reload pages when an ad plays, preserving playback position. YouTube serves an ad roughly every 60 seconds, interrupting users from watching content uninterrupted. Traditional ad blockers get detected by YouTube's anti-adblock system, forcing users to manually reload pages.

The extension automates this process: upon detecting an ad, it captures the exact playback timestamp, reloads the page, and YouTube auto-seeks back to the saved position. This eliminates ads, waiting, and the need to hunt for skip buttons. After three reloads, the extension automatically switches to a helper tab for four seconds, then returns to the primary tab.

If ads reappear, the extension switches to another tab for a few seconds before returning. Chromium's background tabs are throttled, allowing ad states to settle. The timestamp is preserved using the &t=Xs URL param and JavaScript seek. If reloading doesn't clear the ad after three attempts, the extension redirects to an ad-free YouTube mirror.

The extension watches for specific classes, buttons, and overlays to capture video playback. It saves the video's current time to sessionStorage and reloads the page with the timestamp using location.replace(). After a three-second cooldown, the extension prevents reload loops. While Safari blocks ad-hoc signed extensions from auto-injecting into YouTube, the extension offers an alternative solution using JavaScript overlay and AppleScript watcher.

The extension works locally, with no server requests or detection by YouTube's anti-adblock system. It's a passive protest against ads, with each reload counting as a vote against ad views. The extension can be exported as JSON or CSV from the popup, and the data remains local. While it may increase server load due to additional page loads, it reduces ad impressions.

Some users may combine it with other extensions like uBlock Origin, SponsorBlock, and Chrome's built-in ad blocking features for a more comprehensive ad-blocking strategy.

Rewritten by urgent.news; may contain errors — check the original.

Source: github.com

Read the original at github.com →

Report a problem with this story

More in Tech

More from Thursday 26 November →