Sign in

Blog › Hacker News

Image: Firmbee on Pixabay
Hacker News · 3 min read

YouTube Ad Punisher reloads the page when an ad starts

Published Nov 28, 2026

A new open-source browser extension skips YouTube ads by reloading the page and seeking back to your timestamp, avoiding the network blocking that anti-adblock systems detect.

A small open-source project called YouTube Ad Punisher takes an unusual approach to getting rid of YouTube ads: it does not block anything. When an ad begins, the extension notes your playback position, reloads the page, and lets YouTube seek back to where you were. The bet is that after a reload or two, the ad slot comes up empty and the video plays straight through.

The project, published on GitHub by antonpictures, is a Manifest V3 extension for Chrome and other Chromium-based browsers, with an experimental Safari workaround.

How the reload trick works

The extension watches the page for the signs of an ad: the ad-showing class on the player, skip buttons and overlay elements. It checks on a 500 millisecond timer and also through a MutationObserver. When it spots one, it reads the video's current time, stores it in session storage, and reloads the page with a time parameter appended to the URL.

A three-second cooldown prevents reload loops. Live streams get a plain reload, since there is no fixed timestamp to preserve.

If three reloads fail to clear the ad, the extension falls back in one of two ways. It can switch to a helper tab for a few seconds and then back, which relies on Chrome throttling background tabs so the ad state settles. Or it can redirect to a third-party YouTube mirror, with a parameter added to stop the mirror's default replay loop. That mirror is an external service, so it is worth treating with the same caution as any third-party site.

Why not just use a blocker

The pitch rests on a real pain point. Network-level blockers such as uBlock Origin filter requests to ad servers, which is effective but visible: YouTube has spent years building anti-adblock detection that can interrupt playback with warnings. Ad Punisher works entirely client-side and issues ordinary page loads, so there is no filter list to maintain and nothing obvious to detect.

The author says it is meant to sit alongside existing tools rather than replace them. The suggested stack is uBlock Origin for most ads, this extension for whatever slips through, and SponsorBlock for in-video sponsor segments.

An ad log as a side feature

The extension also keeps a local database of every ad it sees, recording the advertiser, duration, skip-button text, video and timestamp. A popup shows stats and top advertisers, and the data can be exported as JSON or CSV. According to the project, nothing leaves the machine. It asks only for storage and tabs permissions, limited to YouTube domains.

What to keep in mind

The approach has clear limits, and the README is upfront about some of them:

  • YouTube changes its page markup periodically, so detection can break without warning.
  • Mid-roll ads on live streams cannot preserve position.
  • Premium upsell interstitials may need an extra reload cycle.
  • Safari support depends on an AppleScript watcher and is described as best-effort.

There is also a larger question the project's own framing raises. The author describes every reload as a small protest against the ad model, and imagines what happens if millions of people install it. In practice, YouTube controls how ads are served on page load, so a trick that depends on reload behavior can be closed by a server-side change. Tools in this category tend to work until the platform adjusts, which is why the project's longevity is the thing to watch.

Why developers should care

The repository is a compact example of a pattern that keeps resurfacing in browser extensions: instead of fighting detection with ever-better blocking, change the workflow so there is nothing to block. The codebase is small, MIT licensed, and easy to read, with a content script, a popup and a minimal service worker. It is a useful reference for anyone learning Manifest V3 extension structure, and a reminder of how quickly the ad-blocking cat-and-mouse game keeps evolving.

Original reporting: github.com

Discussion

Loading comments …

The Repocharts newsletter

Once a week: the biggest repo clashes, the fastest risers and the AI and tech stories that matter. Free, no spam, unsubscribe with one click.

We send a confirmation link first (double opt-in). See our privacy policy.