Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL

antonpictures/youtube-punisher

Networking & Communication

A Chrome extension that reloads YouTube when an ad appears and restores your playback position.

135
2
JavaScript
MIT
4 days old

What it does

YouTube Ad Punisher is a Manifest V3 browser extension for Chrome-based browsers that detects YouTube ads and reloads the page instead of relying on request blocking. Before reloading, it records video.currentTime; the reload adds a &t=Xs URL parameter so YouTube resumes near the same position.

The extension watches for ad state every 500 ms with a MutationObserver, covering the .ad-showing class, skip buttons, and ad overlays. As a fallback, after three failed reload attempts it redirects to the yout-ube.com mirror with &loop=0 to avoid that mirror's default looping. It also logs each detected ad (advertiser, video, playback position, duration, skip text, action) to local storage and offers JSON/CSV export from the popup.

It is aimed at people who watch YouTube in a desktop Chrome-family browser and want a client-side workaround that does not depend on filter lists.

Install and try it

Chrome, Brave, Edge, and Opera use the unpacked-extension flow:

  1. Clone the repository: git clone https://github.com/antonpictures/youtube-punisher.git
  2. Open chrome://extensions, enable Developer mode, click Load unpacked, and select the youtube-punisher folder.
  3. Open a YouTube video. On the next ad, the page reloads and seeks back; click the extension icon to see the logged ad history and export it.

A zip from Releases can replace the clone step. Safari support is experimental: the README describes running yt-ad-watch.sh with Safari's Develop menu enabled, but calls it best-effort and says Chrome is the reliable path.

Limitations

  • Ad detection depends on YouTube's DOM class names, which the README says change periodically; missed ads should be checked in the console under [YT-AdReloader] logs.
  • Mid-roll ads on live streams cannot preserve a position and get a plain reload.
  • Premium upsell interstitials may require a second reload cycle.
  • The fallback mirror (yout-ube.com) is an external service, and its availability is not under the project's control.
  • The extension requests only storage and tabs, and ad history stays local. The project is MIT licensed.

Ad history

Every detected ad is stored with a timestamp, advertiser, video title, playback position, ad duration, skip text, and whether it was reloaded or skipped. The popup shows stats and top advertisers, and lets you export the data as JSON or CSV.

HotRepo's take

The repository appeared in HotRepo's new-project JavaScript ranking on 2026-11-27, gaining 6 stars in a window of under two hours, and its Hacker News thread drew 255 points and 324 comments the day before. The discussion is mostly about whether to pay for YouTube Premium rather than about reload mechanics: some commenters describe Premium as still not ad-free and object to phone verification requirements (1, 2), while others say they have given in and pay (3). One commenter using uBlock Origin and SponsorBlock questioned the claim of an ad roughly every 60 seconds, and a reply noted ad density is set per channel (4, 5). That debate is a useful signal of the audience: the project is a deliberately blunt reload workaround, not a filter-list blocker.

Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.

Hacker News

YouTube Ad Punisher – Auto-reloads YouTube pages when an ad plays
▲ 255 · 324 comments · November 26, 2026

You might also like

  1. redlib-org/redlibA JavaScript-free, ad-free Reddit browser for people who want to read Reddit without tracking and clutter.Rust3,918
  2. black-ant/Ant-BrowserA desktop browser manager for isolated multi-account instances, proxy binding, and local environment control.Go2,184
  3. yetanotherbrowser/yabA minimal native macOS browser that can switch between WebKit and Chromium per tab, with an iPhone companion app.Swift368
  4. mozilla-firefox/firefoxThe official Firefox source repository, for developers who want to read, build or contribute to a major browser engine.JavaScript13,628
  5. LadybirdBrowser/ladybirdAn independent browser engine project for developers who want a web platform not controlled by Chromium, Gecko, or WebKit.C++66,663