Skip to content

0xCUB3/wBlock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1,171 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wBlock Logo

wBlock

The end of Safari ad-blocking B.S.


Download on the App Store

Version Platform License

Join Discord



wBlock Interface

A Safari content blocker for macOS, iOS, and iPadOS.
750,000 rules across 5 extensions, Protocol Buffer storage, LZ4 compression, and iCloud sync.


Note

Looking for a detailed comparison? Check out my comparison guide to see how wBlock stacks up against other Safari content blockers.


Features

Performance

  • 750,000 rule capacity across 5 Safari content blocking extensions per platform (150k each)
  • ~40 MB RAM at idle — Safari's native content blocking API runs rules out-of-process
  • Protocol Buffers + LZ4 for filter storage; streaming I/O keeps memory low during compilation
  • HTTP conditional requests (If-Modified-Since/ETag) so updates only download what changed
  • iCloud sync for filter selections, custom lists, userscripts, and whitelist across devices

Content modification

  • Element Zapper (macOS, iOS, iPadOS, visionOS) — visually select and hide page elements in Safari
  • Tube Cleaner & Player Cleaner — optional built-in userscripts that turn existing media elements into native Safari players before first paint, restoring Picture-in-Picture and background playback; wBlock's content-blocking rules handle ads separately
  • Userscript engine with Greasemonkey API (GM_getValue, GM_setValue, GM_xmlhttpRequest)
  • Userstyle support — install UserCSS themes (.user.css) applied natively as CSS, no JS wrapper needed
  • Custom filter lists via URL, paste, or file import — supports any AdGuard-syntax blocklist
  • Toolbar search for quickly finding filters and userscripts
  • Automatic rule distribution across all 5 content blocker slots for maximum coverage

Blocking

  • Network request blocking — ads, trackers, cookie banners, annoyances
  • CSS injection for cosmetic filtering and element hiding
  • Script blocking for unwanted JavaScript
  • Pop-up and redirect prevention
  • URL tracking-parameter stripping — removes UTM and other tracking params, unwraps shortener/redirect URLs (enabled by default via wBlock Scripts)

Configuration

  • Auto-updates from every hour to every 7 days, or manual. macOS can keep checking through a bundled launch agent and background update service, iOS background checks are best-effort
  • Per-site controls — disable blocking on specific sites from the Safari toolbar
  • Blocked request logger (macOS) — see what's being blocked on each page
  • Per-site settings — whitelist trusted domains, toggle userscripts per site, and switch element zapper rules on or off per domain
  • Regional filters with auto-detection based on your locale
  • Homebrew cask for macOS: brew tap 0xcub3/wblock && brew install --cask wblock



Screenshots


Userscript Management Screenshot
Userscript Management
Manage paywalls, YouTube Dislikes, and more

Settings Screenshot
Settings & Customization
Configure auto-updates, notifications, and preferences

iOS Screenshot

iOS Interface
Full-featured blocking on iPhone

iPadOS Screenshot

iPadOS Interface
Full-featured blocking on iPad




Technical Implementation

Core Architecture

  • Protocol Buffers (libprotobuf) with LZ4 compression for filter serialization
  • Asynchronous I/O with Swift concurrency (async/await, Task, Actor isolation)
  • Streaming serialization to disk minimizes peak memory usage during compilation
  • 5 Safari content blocking extensions per platform (maximum Safari API capacity)
  • SafariServices framework integration for declarative content blocking

Dependencies & Standards

  • SafariConverterLib v4.3.0 for AdGuard to Safari rule conversion
  • Bundled AdGuard scriptlet engine for advanced blocking techniques
  • Swift concurrency (async/await, Task, Actor isolation) with project-level Swift 5 settings
  • VoiceOver and Dynamic Type support throughout the SwiftUI app
  • SwiftProtobuf for cross-platform filter storage format


Support Development

wBlock is free and open source.
If you want to support the project:


Donate Button



FAQ

How does wBlock compare to other ad blockers?
Check out our comparison guide vs uBlock Origin Lite, Wipr 2, and AdGuard's Safari apps.
Should I install wBlock from the App Store or the DMG/Homebrew release?
The App Store version is usually preferred because it handles app updates automatically. The DMG/Homebrew release has the same features and is available for users who prefer installing outside the App Store.
Should I use wBlock alongside another ad blocker?

No. Use one general-purpose content blocker at a time.

There is no controlled study proving that every possible combination of ad blockers harms every page. However, browser architecture and extension documentation support avoiding overlapping blockers:

  • Extensions can make conflicting changes. Mozilla documents that when two extensions attempt conflicting modifications to the same response header, only one change may succeed. Multiple blockers can therefore produce order-dependent behavior rather than a predictable combination of their protections. See Mozilla’s webRequest documentation.

  • Request interception has measurable computational costs. Chromium describes serialization, inter-process communication, persistent-process, and extension-response processing costs associated with blocking request handlers. Running redundant filtering systems duplicates at least some rule evaluation and page-processing work. See Chromium’s explanation of Web Request and Declarative Net Request and Chrome’s Manifest V3 overview.

  • Major blocker maintainers explicitly advise against stacking. The official uBlock Origin README states: “Do NOT use uBO with any other content blocker.” It explains that another blocker can prevent uBO’s privacy or anti-blocker-defusing features from working correctly. See uBlock Origin’s official documentation.

  • Documented failure modes include slower loading and broken functionality. AdGuard warns that two blockers may compete over the same requests, causing slower page loading, broken websites, or video-playback problems. See AdGuard’s guidance.

For wBlock specifically, another blocker also makes troubleshooting impossible as well. When an advertisement survives or a site breaks, either blocker’s network rules, cosmetic rules, scriptlets, exceptions, or execution order may be responsible. The second blocker is therefore a confounding variable. Disable all other content blockers before reporting a wBlock issue.


Skill Issue

Installing redundant blockers is not defense in depth when both tools compete at the same interception layer. It is an uncontrolled experiment with no control group.

Can I use my own filter lists?
Yes. You can add any AdGuard-compatible filter list by URL, paste rules directly, or import from a file.
Should I enable more filter lists for better blocking?
Usually not. The recommended defaults already cover most ads and trackers, and most other general-purpose lists overlap with them. Enabling more mainly uses up Safari's rule limit and increases the chance of site breakage. The exceptions are Annoyances filters (cookie banners, popups, social widgets) and regional filters for non-English sites, which cover things the defaults do not.
Does wBlock slow down Safari?
No in normal use. wBlock uses Safari's native declarative content blocking API, which applies compiled rules outside the app process. Local idle checks sit around ~40 MB, and page loading stays on Safari's native blocker path.
Do userscripts work on iOS and iPadOS?
Yes. The userscript engine implements common Greasemonkey APIs (GM_getValue, GM_setValue, GM_xmlhttpRequest, GM_addStyle) on iOS, iPadOS, and macOS via Safari Web Extensions.
How do I block Twitch ads?
wBlock bundles the AdGuard Extra userscript, which can help with Twitch ads by talking to Twitch's GraphQL API (gql.twitch.tv) — the same general approach uBlock Origin users rely on. It ships disabled by default, so enable it for Twitch:

1. Open wBlock and go to the Userscripts section.
2. Find AdGuard Extra in the built-in list and toggle it on.
3. Reload any open Twitch tabs.

This is best-effort, community-style ad blocking: Twitch frequently changes how ads are served, so it may occasionally break until the userscript is updated. There is no guarantee every ad is removed.
What are Tube Cleaner and Player Cleaner?
They are optional built-in userscripts, inspired by Vinegar and Baking Soda, that expose Safari's native controls on a site's existing media element. They ship disabled by default; enable them in the Userscripts section.

Tube Cleaner targets YouTube (including embeds). It lets YouTube create and initialize its own <video> and SABR/MSE stream, then applies native controls and hides YouTube's custom chrome before it can paint. Reusing the same media element preserves buffering and adaptive playback while restoring Picture-in-Picture and background playback. It mirrors YouTube chapters and subtitles into Safari's native media menus and skips known segments through SponsorBlock's privacy-preserving hash-prefix API. Its compact SB panel provides SponsorBlock-style category colors and per-category Auto skip, Show skip button, or Disabled behavior, plus minimum-duration, Undo-notice, current-video, and channel-exclusion controls. An opt-in DA panel can use DeArrow to replace submitted titles and thumbnails on the watch page and visible YouTube cards, restore originals on hover, or exclude the current channel. Results are session-cached; random fallback thumbnails, title reformatting, submissions, and voting remain features of the full DeArrow extension. SponsorBlock and DeArrow API data are used under CC BY-NC-SA 4.0. SB and DA sit on their own toolbar row below the quality and audio/video controls. On iPhone and iPad, Safari's native controls own playback while the compact toolbar appears above them; mobile quality choices apply only to the current video so a fixed range cannot stall the next ManagedMediaSource stream. Tube Cleaner also preserves the remote-playback restriction WebKit requires for that stream, while audio-only remains a macOS feature. It follows the active player as YouTube retains offscreen Shorts. Ads remain the responsibility of wBlock's content-blocking rules.

Player Cleaner targets custom players on other websites (video.js, JW Player, Plyr, Flowplayer, MediaElement, Clappr, Media Chrome/Mux, and more), including shadow-root players such as Archive.org's <play-av>. It enables native controls immediately. When a safe direct source is available in the light DOM, it removes the custom chrome while retaining the original media element; shadow components and opaque HLS/DASH/MSE pipelines remain intact and continue using the site's stream machinery. It recovers subtitle and chapter sidecars exposed by the page or common player APIs, fills missing system Now Playing metadata and media-key actions, and remembers playback speed, volume, mute state, subtitle language, and resume position per site. If a site misbehaves, disable Player Cleaner for that site from the wBlock toolbar.
Where do I find them, and what can I test them on?
Both ship disabled. Open the Userscripts tab: Tube Cleaner and Player Cleaner sit at the top of the General section. Switch one on, then reload the page you want to test. If they are not in the list, you are running a wBlock build from before this change — quit wBlock and run this branch from Xcode (a Homebrew or release install cannot contain branch code).

Tube Cleaner (YouTube and embeds):
Big Buck Bunny — long, many qualities, good for the quality menu
Sintel
Tears of Steel
• Embeds: youtube.com/embed and youtube-nocookie.com/embed
Check that native controls appear without a flash of YouTube chrome, that the quality and audio-only controls work, that Picture-in-Picture works, and that audio keeps playing in another tab. The DA panel is off by default; enable it to test DeArrow titles, thumbnails, original-on-hover behavior, and channel exclusions. Ad behavior depends on the enabled wBlock filter lists.

Player Cleaner (other sites' custom players), one demo per supported library:
• video.js / Media Chrome — videojs.org
• Plyr — plyr.io
• JW Player — stream tester and demo
• Archive.org shadow-root JW Player — FedFlix sample
• Clappr — clappr.io and cdn.clappr.io
• MediaElement — mediaelementjs.com
• hls.js — hls.js demo
• dash.js — DASH reference player
Check that native controls appear promptly, Picture-in-Picture and fullscreen work, and playback does not restart when the custom chrome disappears. HLS/DASH/blob players may retain their stream pipeline while using native controls. If a site misbehaves, disable Player Cleaner for that site from the wBlock toolbar.
How often do filters update?
Auto-update intervals are configurable from 1 hour to 7 days, or manually triggered. On macOS, enabling auto-update registers a bundled launch agent that can keep checking while the app is closed through a background update service. On iOS and iPadOS, background checks are best-effort and may wait until the system wakes wBlock or you reopen it. Opening Safari does not trigger updates. Updates use HTTP conditional requests (If-Modified-Since/ETag headers) when servers support them, which reduces unnecessary downloads.
Is the element zapper available on iOS and iPadOS?
Yes. Open the wBlock extension popup in Safari and tap Activate Element Zapper.



Credits

@arjpar · @ameshkov · @shindgewongxj


Discord Privacy Issues


Developed by 0xCUB3




About

The next-generation ad blocker for Safari.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages