A Chrome extension that records and classifies every network request your browser makes — trackers, analytics, ads, fingerprinting scripts, session replay tools, and more — so you can see (and block) exactly what a site is doing in the background.
Browser-native privacy and tracker analysis powered by fully local ML inference.
Specter is a Chrome MV3 extension that intercepts and classifies network requests in real time — trackers, analytics, fingerprinting scripts, session replay tools, ad infrastructure, and more — entirely on-device using ONNX Runtime + WebAssembly.
No proxy. No cloud inference. No telemetry. No browsing data ever leaves your machine.
Most privacy extensions rely heavily on static blocklists. While effective against known trackers, blocklists struggle with rapidly changing ad infrastructure, newly generated domains, behavioral tracking patterns, and fingerprinting systems that evolve faster than manually maintained signatures.
Specter explores a browser-native alternative:
- Lightweight local inference
- Real-time request analysis
- Explainable classifications
- Privacy-preserving architecture
- Zero external infrastructure
- Low-latency ML inference inside Chrome MV3
The project also serves as an experiment in running performant ML systems entirely inside Manifest V3 service worker constraints.
- Classifies each request using a local XGBoost ML model — no cloud calls, no latency
- Blocks trackers and strips tracking parameters from URLs using Chrome's
declarativeNetRequestAPI (opt-in, off by default) - Shows a live feed of requests as you browse, color-coded by category and confidence score
- Maps third-party request flow in a force-directed Network graph (dashboard bottom panel)
- Scores each site 0–100 based on tracker density, fingerprinting exposure, and ad activity
- Stores every session locally so you can review your browsing history and compare sites over time
flowchart LR
A[Chrome Request] --> B[Feature Extraction]
B --> C[ONNX Runtime Web]
C --> D[Classification Engine]
D --> E[Dashboard UI]
D --> F[Privacy Scoring]
D --> G[Session Storage]
- Chrome intercepts outgoing requests using MV3 APIs
- Specter extracts lightweight request and domain features
- Features are passed into a local ONNX model
- Inference executes inside the extension service worker
- Results are classified, scored, and surfaced in the dashboard
- Sessions are stored locally for later analysis
Specter ships with a pre-trained XGBoost model located at:
extension/data/model.json
The model classifies requests into five categories:
| Class | Description |
|---|---|
legitimate |
First-party assets, fonts, stylesheets, CDN resources |
analytics |
Analytics and telemetry providers |
ad_network |
Ad exchanges, DSPs, bidding infrastructure |
behavioral |
Cross-site trackers and retargeting systems |
fingerprinting |
Browser fingerprinting scripts and infrastructure |
session_replay detection is handled separately using deterministic heuristics.
The classifier extracts 27 features per request, including:
- URL entropy
- Path semantics
- Domain structure
- Header patterns
- Resource size
- Query parameter characteristics
- TLD patterns
- Known infrastructure indicators
- Tokenized path signals
Inference executes locally in under 50ms using ONNX Runtime Web.
| Metric | Value |
|---|---|
| Training Samples | 25,290 requests |
| Feature Count | 27 |
| Classes | 5 |
| Accuracy | 96.2% |
| Weighted F1 | 0.967 |
| Inference Runtime | <50ms |
| Model Format | ONNX JSON |
| Model Size | ~2.4 MB |
Manifest V3 replaces persistent background pages with ephemeral service workers, introducing several engineering constraints:
- Cold starts
- Limited execution lifetime
- Resource-sensitive runtime behavior
- Restricted long-running tasks
- Memory limitations
Specter is designed around these constraints while maintaining low-latency request classification.
Running inference directly inside a browser extension introduces additional challenges:
- Minimizing model size
- Preventing UI blocking
- Managing inference latency
- Reducing memory overhead
- Supporting WebAssembly execution environments
Specter uses ONNX Runtime Web for efficient local execution without requiring external infrastructure.
You can retrain the model locally using your own crawl data.
npm run chromenpm run crawlExport sessions from the Specter dashboard and place them into:
tools/exports/
pip install xgboost scikit-learn onnxmltools numpy
python tools/train.pyOutputs:
extension/data/model.json
extension/data/model_labels.json
The training pipeline:
- Filters to confidence > 0.70
- Applies class balancing
- Generates feature importance rankings
- Prints classification reports
- Exports ONNX-compatible model artifacts
All browsing data remains local to the device.
Specter does not:
- collect telemetry
- sync browsing history
- proxy traffic
- upload request data
Optional VirusTotal lookups are disabled by default and require a user-provided API key.
| Key | Contents |
|---|---|
session:current |
Active session metadata |
requests:{session_id} |
Classified request objects |
scores:{session_id} |
Per-site privacy scores |
sessions:history |
Session summaries |
settings |
User preferences |
blocking:dynamic_domains |
Domains promoted to DNR block rules |
blocking:allowlist |
Per-site domain overrides |
blocking:stats:{session_id} |
Blocked/stripped counts per session |
blocking:daily |
Calendar-day blocked count for the popup |
fp:session_seed (session storage) |
PRNG seed for fingerprint defense while a session is active |
Install directly from the Chrome Web Store.
npm install
npm run bundle-libsLoad the extension:
- Open
chrome://extensions - Enable Developer mode
- Click Load unpacked and select the
extension/folder - Pin the Specter icon to your toolbar
The extension ships as plain JavaScript with no frontend build system.
Requirements: Chrome 114+ · Node.js 18+ (build step only)
Click the Specter icon in your toolbar, then click ▶ NEW SESSION. Browse normally. Specter records every request in the background.
Open the dashboard (OPEN DASHBOARD in the popup). The feed shows each request with its category, domain, confidence score, and size. Click any row to see the full URL, headers, response metadata, and which signals drove the classification.
In the dashboard bottom panel, open the Network tab to see a live force-directed graph: your site and third-party domains as nodes, request flow as edges. It respects the same filters and site scope as the timeline. Drag nodes to rearrange, hover for details, click a domain to filter the feed, or export the view as SVG.
Go to Settings → Blocking and toggle Enable blocking. Blocking is off by default.
With blocking on, Specter:
- Blocks high-confidence trackers using
declarativeNetRequestdynamic rules - Strips tracking parameters (
fbclid,gclid,utm_*, etc.) from URLs before requests are sent - Shows a red
BLOCKEDor amberSTRIPPEDbadge on affected feed rows
If a site breaks, click the blocked request in the feed and choose Allow on this site or Allow everywhere to add it to the allow-list.
Click the clock icon in the dashboard nav to open Session History. Click any session to see a per-site breakdown with tracker counts and privacy scores. Export a full JSON dump or copy a plain-text report.
All settings are in Dashboard → Settings.
| Setting | Default | Description |
|---|---|---|
| Autoscroll | On | Feed scrolls to new rows automatically |
| Min confidence | 0% | Hides requests classified below this confidence |
| Data retention | Forever | Auto-delete sessions older than N days |
| VirusTotal API key | — | Enables domain reputation lookups in the detail panel |
| Use ML classifier | On | Switch to rule-based classifier if off |
| Enable blocking | Off | Master switch for the blocking engine |
| Blocking mode | Smart | Smart (ML-driven) · Strict (all third-party) · Param strip only |
| Block threshold | 85% | Confidence required to block in Smart mode |
| Block session replay | On | Always block Hotjar, FullStory, LogRocket, etc. |
| Block fingerprinting | On | Always block canvas/font/WebGL fingerprint scripts |
| Block behavioral | On | Block behavioral trackers above threshold |
| Block ad networks | On | Block ad exchanges and bidding infrastructure above threshold |
| Block analytics | Off | Block analytics (may break some sites) |
| Enable fingerprint defense | Off | MAIN-world noise on canvas/WebGL/audio/navigator/fonts before page scripts |
| FP defense surfaces | All on | Per-surface toggles when master switch is on |
specter/
├── extension/ Chrome extension (load this folder)
│ ├── dashboard.html/js/css
│ ├── graph.js Network tab (D3 force graph, v1.4)
│ ├── popup.html/js/css
│ ├── blocking-ui.js Blocking settings UI + feed badges
│ ├── blocking.js Adaptive blocking engine (DNR rules)
│ ├── fp-defense.js MAIN-world fingerprint API hooks (v1.3)
│ ├── fp-defense-ui.js Fingerprint defense settings UI
│ ├── service_worker.js
│ ├── shared.css
│ └── data/
│ ├── blocking_rules.json
│ ├── model.json
│ ├── model_labels.json
│ └── sites.txt
│
├── tools/
│ ├── crawl.js
│ ├── launch-chrome.js
│ ├── train.py
│ └── exports/
│
├── scripts/
│ └── bundle-libs.js
│
└── LICENSE
- Incremental model updates
- Expanded tracker taxonomy
- Improved phishing detection
- Better explainability tooling
- Lightweight model quantization
- Request clustering
- Advanced session analytics
- Performance benchmarking suite
- Load the extension unpacked as described in Development setup
- Edit files in
extension/— changes take effect after clicking ⟳ inchrome://extensions - The service worker reloads automatically when you restart a session from the popup
- No build step for the extension itself — only
npm run bundle-libsis needed once - Before opening a PR:
npm run bundle-libs && npm run validate(same checks as GitHub Actions CI)
Chrome Web Store uploads run automatically when you publish a GitHub Release whose tag matches extension/manifest.json (see scripts/get-cws-token.md for OAuth setup).
Note
The extension uses Manifest V3. webRequestBlocking is not available to regular (non-enterprise) MV3 extensions. All blocking is done via declarativeNetRequest. Do not add webRequest blocking listeners — they will be silently ignored.
MIT — Divij Agarwal. See LICENSE.