An ultra-lightweight, privacy-focused content filtering engine designed to reduce unwanted advertising, trackers, and suspicious embedded content while maintaining exceptional performance and low runtime overhead.
- Runs at
document-startfor maximum early-page protection. - Singleton guard prevents duplicate execution across reinjections.
- Designed for minimal CPU, memory, and layout impact.
- Avoids heavy polling loops and unnecessary recalculations.
Allows full opt-out per domain for compatibility and control.
- Stores excluded sites locally via
GM_getValue - Instantly bypasses all filtering logic on excluded domains
- Lightweight lookup with no runtime scanning overhead
- 🚫 Exclude this site
- 🔄 Clear exclusions
Intercepts and blocks unwanted requests at the browser level using:
fetch()interceptionXMLHttpRequestinterception- Dynamic
srcassignment filtering (images, scripts, iframes)
- Advertising networks
- Analytics services
- Tracking & fingerprinting providers
- Sponsored content delivery platforms
A two-tier adaptive filtering system:
- Immediately removes known ad scripts, images, and iframe sources
- Executes only on DOM additions (no continuous scanning)
- Minimal CPU overhead per mutation batch
- Activates only under increased DOM activity
- Performs broader inspection of newly injected nodes
- Detects suspicious iframe patterns dynamically
- Avoids full DOM traversal unless necessary
Instant visual suppression of common advertising elements:
- Sponsored content blocks
- Banner and promotional containers
- Ad iframes and embeds
- Known ad-related IDs and class patterns
Applied instantly at document-start for zero delay.
A lightweight MutationObserver system designed for efficiency:
- Observes only DOM additions
- Applies fast-path filtering immediately
- Uses adaptive “budgeting” to prevent CPU spikes
- Escalates to deeper scanning only when needed
Uses IntersectionObserver to improve media efficiency:
- Activates videos only when in viewport
- Reduces background decoding and playback overhead
- Improves GPU/CPU efficiency on media-heavy pages
This script operates with strict privacy guarantees:
- ❌ No data collection
- ❌ No external server communication
- ❌ No analytics or telemetry
- ❌ No user tracking
- ❌ No account requirements
All processing happens locally in the browser.
Phantom+Specter is designed around three principles:
Instead of aggressively rewriting pages, it:
- Targets only known unwanted patterns
- Avoids unnecessary DOM traversal
- Minimizes observer workload
- Prefers selective intervention over blanket modification
The goal is silent, efficient improvement without destabilizing modern web applications.
Released under the MIT License.
You are free to:
- Use it personally or commercially
- Modify and extend it
- Redistribute or fork it
Provided “as-is”, without warranty of any kind.