Next-Generation High-Performance Ad & Tracker Blocker for Google Chrome
Zero CPU Overhead • Cosmetic Element Cleaning • Real-time Network Logger • Temporary Element Zapper
ShieldBlock is a lightweight, ultra-fast Chrome extension engineered from the ground up for Manifest V3. By leveraging Chrome's native declarativeNetRequest (DNR) API, ShieldBlock intercepts and blocks network requests (ads, tracking scripts, telemetry, and annoyance popups) at the browser core level without consuming main-thread CPU cycles or memory.
Beyond network blocking, ShieldBlock features an advanced Cosmetic Filtering Engine powered by debounced DOM observers, an interactive Element Picker & Zapper, a Live Network Debug Logger, and Remote Filter Subscriptions.
| Feature | Description |
|---|---|
| 🚀 Native DNR Network Engine | Blocks ad networks (DoubleClick, Taboola, Outbrain) natively at browser network layer before download. |
| ⚡ Element Zapper (Temp) | Click any annoying element on a page to instantly erase it without saving permanent rules. |
| 🛡️ Element Picker (Permanent) | Select DOM elements with automatic strict selector generation (body > main > div:nth-of-type(2)). |
| 📊 Real-time Network Logger | Live streaming view of blocked requests, resource types, and rule IDs in a separate dashboard. |
| 🌐 Remote Filter Subscriptions | Subscribe to remote JSON filter lists with automatic rule namespace isolation (ID >= 1,000,000). |
| 🔓 Anti-AdBlock Overlay Cleaner | Detects and removes anti-adblock modal traps and restores page scrolling automatically. |
| 🎵 Spotify Ad Acceleration | Bypasses DRM/MSE buffers using a Main World window.Audio proxy interceptor. Mutes and fast-forwards ads at 16x speed to organically skip in 1-2s. |
| Detects YouTube video ads, mutes audio, fast-forwards at 16.0x speed, and auto-clicks Skip Ad buttons instantly. | |
| 🎛️ Popup Mini Dashboard | Quick Control Center right inside the toolbar popup to toggle filter lists (Ads, Trackers, Annoyances) in real-time. |
| 🎨 Glassmorphic Dashboard | Sleek UI with global toggle, stats counters, domain allowlist editor, and JSON configuration backup. |
| 🔐 Zero-innerHTML Security | Built 100% with strict DOM node creation (createElement / textContent) to eliminate XSS vectors. |
┌────────────────────────┐
│ Manifest V3 Engine │
└───────────┬────────────┘
│
┌──────────────────────────┼──────────────────────────┐
▼ ▼ ▼
┌────────────────────┐ ┌────────────────────┐ ┌────────────────────┐
│ declarativeNet │ │ Background Service │ │ Content Script │
│ Request (DNR) │ │ Worker (JS) │ │ (Cosmetic Filter) │
└──────────┬─────────┘ └─────────┬──────────┘ └─────────┬──────────┘
│ │ │
┌────────┴────────┐ ┌────────┴────────┐ ┌────────┴────────┐
│ Static Rulesets │ │ Storage & State │ │ MutationObserver│
│ (Ads/Trackers) │ │ (Local/Session) │ │ (150ms Debounce)│
└─────────────────┘ └─────────────────┘ └─────────┬───────┘
▼
┌─────────────────┐
│ Main World Audio│
│ Proxy Hook │
└─────────────────┘
ShieldBlock is built with an aggressive low-footprint philosophy to ensure zero memory leaks and minimal CPU/battery impact:
- Combined Selector Queries: Instead of running multiple individual
querySelectorAllloops, ShieldBlock compiles CSS selectors into a single pass, drastically reducing JS-to-C++ DOM bridge crossings and V8 Heap Garbage Collection overhead. - Tab Visibility Power Saver: Listens to
visibilitychangeevents (document.hidden). When a tab moves to the background, ShieldBlock automatically disconnects DOM MutationObservers and pauses polling timers, allowing background tabs to consume 0% CPU and zero extra RAM. - Spotify & YouTube Media Enforcement: Event-level listeners (
ratechange,volumechange) override website scripts that attempt to un-mute or slow down ad playback during video/audio ads. - Rule ID Namespace Isolation:
- Internal Rules (Allowlist / Global Toggle): IDs
1..999,999 - Custom Subscriptions: IDs
>= 1,000,000
- Internal Rules (Allowlist / Global Toggle): IDs
Because ShieldBlock is configured for high-performance developer mode with the declarativeNetRequestFeedback permission, install it as an unpacked extension:
- Clone the repository:
git clone https://github.com/harshitthek/ShieldBlock.git cd ShieldBlock - Open Google Chrome and navigate to
chrome://extensions. - Enable Developer mode using the toggle switch in the top-right corner.
- Click Load unpacked in the top-left menu.
- Select the
ShieldBlockdirectory. - ShieldBlock is now active! Pin it to your browser toolbar for quick access.
├── manifest.json # MV3 configuration declaration
├── background.js # Service worker & state controller
├── content.js # Cosmetic filtering, anti-adblock & element picker
├── content.css # Element picker overlay modal styles
├── popup.html / css / js # Extension toolbar popup interface
├── options.html / css / js # Fullscreen dashboard & settings manager
├── logger.html / css / js # Real-time network logger window
├── rules/
│ ├── rules_ads.json # Static network ad blocking rules
│ ├── rules_trackers.json # Static network tracker blocking rules
│ └── rules_annoyances.json # Static annoyance & popup blocking rules
├── icons/ # Extension brand icons
├── LICENSE # MIT License
└── README.md # Project documentation
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.