Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/alexperezortuno/ce-blocker/llms.txt

Use this file to discover all available pages before exploring further.

Traffic Blocker is a Chrome Manifest V3 extension that gives developers and power users precise control over which network requests their browser is allowed to make. Powered by Chrome’s declarativeNetRequest API, it intercepts and drops matching requests at the network layer — before any page script, image, or tracking pixel ever loads. Rules are managed through a clean Vue 3 popup UI and take effect instantly without requiring a page reload.

Key Features

Wildcard URL Patterns

Block any request matching a pattern such as *://*.example.com/*. Wildcards cover protocol, subdomain, path, and query string.

Initiator Domain Filtering

Optionally scope a rule to requests that originate from one or more specific domains (initiatorDomains). When no initiator domain is set, localhost is automatically added to excludedInitiatorDomains so local development traffic is never accidentally blocked.

Enable / Disable Toggle

Flip a single switch to pause or resume all blocking instantly. The label turns green when blocking is active, making state obvious at a glance.

Export & Import Rules

Back up your rule set as a JSON file and restore it on any machine. Import supports both Replace (overwrite) and Merge (append) modes.

Preset Blocklists

One-click loads for four curated lists — Advertising, Trackers, Social Media, and Malware — so you can get up and running without writing a single rule by hand.

Blocked Traffic Counter

A live counter records every request that has been blocked. Reset the counter at any time from the Statistics view.

Dark Mode

Toggle dark mode in Settings. Your preference is persisted across browser sessions via chrome.storage.local.

Import from Remote URL

Fetch a blocklist JSON file directly from a remote URL so you can subscribe to community-maintained lists without any manual copy-paste.

Preview & Edit Rules

Click any rule row to open a modal where you can inspect and edit its urlFilter, initiatorDomains, and excludedInitiatorDomains fields in place.

Search & Filter

A search bar (shown when two or more rules exist) filters the rule list in real time by URL pattern or initiator domain.

Reorder Rules

Move any rule up or down in the list to control matching priority. Higher-positioned rules take precedence when multiple patterns match the same request.

Undo Delete & Clear All

Deleted rules can be restored within a 5-second undo window. A Clear All button (trash icon) removes every rule and disables the blocker in one click.

How It Works

When you add a rule in the popup, Traffic Blocker writes it to chrome.storage.local and then registers it as a Chrome declarativeNetRequest dynamic rule via the background service worker. Dynamic rules are enforced by the browser’s network stack — they fire before any page script executes, before images decode, and before tracking pixels are fetched. This means blocked requests never consume bandwidth or CPU on the page side, and no JavaScript on the target page can work around them. The background service worker (assets/background.js, compiled from src/background/background.ts) also listens on chrome.webRequest.onErrorOccurred to detect blocked requests and increment the statistics counter stored in chrome.storage.local.

Architecture Overview

Traffic Blocker is composed of two runtime contexts that communicate via chrome.runtime.sendMessage:
ContextSourceRole
Popup (Vue 3 SPA)src/main.tsApp.vueRenders the Dashboard, Settings, and Statistics views; reads and writes rules to chrome.storage.local
Background service workersrc/background/background.tsSyncs declarativeNetRequest dynamic rules with storage; counts blocked requests
The popup is a standard Vue 3 application bootstrapped in src/main.ts with Vue Router (history-mode routing via createWebHistory) and Font Awesome icons. Vite builds both contexts into the dist/ folder alongside the manifest.json.

Privacy

Traffic Blocker stores all data — rules, toggle state, dark mode preference, and the blocked-request counter — exclusively in chrome.storage.local. No data is transmitted to any external server. The only outbound network call the extension ever makes is the optional Import from URL feature, which fetches a URL you explicitly provide.

Build docs developers (and LLMs) love