An MV3 extension that removes YouTube's ad breaks and ad surfaces. Zero dependencies, no build step, no remote code.
- Network (
rules/ads.json): 5 declarativeNetRequest block rules covering DoubleClick, Syndication, and Google Ad Services hosts, plus YouTube/Googlepageadendpoints (youtube.com/pagead/,youtube.com/pagead/lvz,google.com/pagead/,google.com.my/pagead/). Playback telemetry (/ptracking,/api/stats/delayplay,/api/stats/atr) is not listed, so it is never blocked. - Data (
src/inject.js): Runs in theMAINworld atdocument_start, stripping ad breaks and promo slots fromfetch, XHR,ytInitialPlayerResponse, andytInitialData, while preservingclarificationRenderercontext panels. XHR reads are cached per instance so repeated access cannot double-count. - Player (
src/content.js): Watches#movie_playeron a 750 ms tick forad-showing/ad-interrupting, clicks skip buttons, nudges unskippable ads toduration - 0.1, mutes/restores audio, and never callspause(). The running total is shown as an in-page HUD (MV3 cannot paint a toolbar badge). - Surface (
src/content.css): Hides ad slots and enforcement backdrops whenhtml[data-ytadclean-hide="1"]is set, and suppresses ad chrome during active skips (html[data-ytadclean-skip="1"]).
- Load unpacked in
brave://extensionsorchrome://extensionsfrom this folder. - Run automated tests:
npm test(ornode --test test/verify.js), and syntax checks:npm run check. - The shipped package is only
manifest.json,src/,rules/, andicons/—test/,_metadata/, and other artifacts are excluded (see.gitignore).