Skip to content
Zakii360Public

About

Opensource adblocker for YouTube and targets Google Vignette and more annoying popups that pollute the internet!

Resources

Stars

36 stars

Watchers

0 watching

Forks

Latest commit

 

History

41 Commits

Folders and files

Repository files navigation

WeBlock

WeBlock logo

Available on Firefox Add-ons

A Chrome (Manifest V3) extension that blocks ads, trackers and page annoyances, with extra work on YouTube ads and Google's full-screen "vignette" ads. Open source, no accounts, nothing leaves your browser.

What it does

  • Network blocking. Roughly 30,000 rules are always on; Chrome lets extensions share a larger pool, so WeBlock switches on the rest of its ~100,000+ rules when there's room. Sources: EasyList, EasyPrivacy, uBlock Origin filters / privacy / badware, AdGuard Tracking Protection, Peter Lowe's list, and filter-lists/weblock.txt (our own).
  • Tracker parameters. utm_*, fbclid, gclid and friends are stripped from every request.
  • Page cleanup. Ad containers, cookie banners and "sponsored" blocks are hidden with CSS from the same lists. Rules for a site are only injected on that site.
  • Procedural filters. :has-text(), :upward() and :remove() from uBO lists are handled in content.js.
  • Scriptlets. set-constant, json-prune, abort-on-property-read/write, abort-current-script, no-fetch-if, no-setTimeout/Interval-if, addEventListener-defuser, window.open-defuser, remove-attr, remove-class. They run before the page's own scripts.
  • YouTube. youtube.js strips ad data from player and feed responses, then skips or fast-forwards any ad that still plays, removes the "ad blockers not allowed" wall, and nudges the player if it sits buffering for a few seconds with no ad showing (YouTube's slowdown for ad-blocker users).
  • Google vignette. Strips the #google_vignette hash and hides the overlay.
  • Element picker. "Hide an element" in the popup; picks are saved per site.
  • Pause per site / master switch.
  • Daily list refresh. Domain-level rules are re-downloaded every day without waiting for a new release. A GitHub Action also refreshes the stored lists daily and rebuilds the extension.

Limits you should know about

  • Chrome's Manifest V3 caps what an extension can do compared with uBlock Origin on MV2. WeBlock gets close, not identical.
  • YouTube changes how it serves ads regularly. When ads come back, src/youtube.js is the place to look. Ads stitched into the video stream server-side can only be skipped, not removed.
  • The toolbar badge counts requests blocked on the current page. Chrome only exposes exact counters to unpacked extensions, so the popup number can be missing in installed builds.
  • The buffering nudge is a workaround, not a cure. If YouTube throttles the video download itself on its servers, nothing in the browser can undo that.
  • Scriptlets and YouTube handling run on the top-level page only, not inside iframes.

Build (intermediate programming knowledge)

Needs Node 20+.

npm install
npm run build:all    # download lists, compile, validate
npm test

Load dist/ from chrome://extensions with Developer mode on. A prebuilt zip is attached to the "latest-build" release. Instructions for that are below.

Want an easier build? (minimal programming knowledge)

Open the latest release from the releases page and download the first .zip file Extract the contents and then head to chrome://extensions with Developer mode on and click load unpacked and choose the unzipped folder.

Adding your own rules

Put ABP/uBO-style filters in filter-lists/weblock.txt and rebuild. To add a whole list, add an entry to scripts/lib/sources.js.

Layout

src/background.js      rule sync, CSS injection, messaging
src/content.js         procedural filters, vignette hash
src/scriptlets.js      page-world helpers (bundled into runner.js)
src/youtube.js         YouTube handling
src/picker.js          element picker
scripts/               list download and build
filter-lists/          downloaded lists + weblock.txt

MIT licensed. Filter lists belong to their maintainers and keep their own licences.

Firefox / AMO build

The Chrome build is kept unchanged. A separate Firefox build is generated with Firefox's MV3 background-script fallback and Firefox-compatible Declarative Net Request limits. It targets Firefox 140+ and sets a stable GUID Gecko add-on ID and the built-in no-data-collection declaration. Keep that ID unchanged after submitting the add-on to AMO.

Requirements: Node.js 20+ and npm. From this directory run:

npm install --no-audit --no-fund
npm test
npm run build:firefox

The installable AMO archive is written to WeBlock-Firefox-2.0.0.zip. The build script also creates dist-firefox/ for inspection. GitHub Actions publishes this ZIP directly as a Firefox Release asset (not as a nested Actions artifact). npm run validate:firefox can be run after the build. The Firefox build caps dynamic rules at 5,000 total (4,000 refreshed filter rules plus up to 1,000 paused-site allow rules).

WeBlock still periodically downloads plain-text filter lists from EasyList, AdGuard, and Peter Lowe's list providers. It does not send visited page URLs, page contents, or browsing history to those providers. List downloads and their provider endpoints should be disclosed in the AMO listing/privacy information.

About

Opensource adblocker for YouTube and targets Google Vignette and more annoying popups that pollute the internet!

Resources

Stars

36 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages