Block ads, trackers, and annoyances. Force dark mode, focus mode, and snipe any element.
- 361+ network blocking rules covering 200+ ad networks, analytics, fingerprinting, and malware domains
- 100+ CSS cosmetic selectors for hiding ad elements instantly
- Blocks Google Ads, DoubleClick, Taboola, Outbrain, and many more
- Removes cookie consent popups, newsletter modals, and push notification prompts
- One-click dark mode on any website — even sites that don't support it
- Smart CSS inversion that keeps images and videos looking normal
- Remembers your preference per site
- Strip away all distractions — sidebars, comments, recommendations, floating elements
- Centers main content for pure, distraction-free reading
- Perfect for articles, blogs, and documentation
- Right-click any annoying element to permanently block it
- Crosshair targeting with red highlight preview
- Automatically remembers blocked elements per site
- Press ESC to cancel
- Glassmorphism UI with animated counters
- Track ads blocked today, all time, and per site
- Per-site whitelist toggle
- Premium dark theme with purple/blue gradient accents
-
Download this repository:
git clone https://github.com/YOUR_USERNAME/AdShield.git
-
Open Chrome and go to:
chrome://extensions/ -
Enable Developer mode (toggle in top right)
-
Click "Load unpacked"
-
Select the
AdShieldfolder -
Done! 🎉 Click the 🛡️ icon in your toolbar
AdShield/
├── manifest.json # Chrome extension manifest (MV3)
├── service-worker.js # Background service worker
├── rules/
│ └── rules.json # 361+ declarativeNetRequest blocking rules
├── content/
│ ├── content.js # Main ad hiding content script
│ ├── content.css # Instant CSS ad hiding
│ ├── youtube.js # YouTube-specific ad handling
│ ├── youtube.css # YouTube ad element hiding
│ ├── darkmode.js # Force dark mode feature
│ ├── focusmode.js # Focus mode feature
│ └── sniper.js # Element sniper feature
├── popup/
│ ├── popup.html # Extension popup UI
│ ├── popup.css # Popup styling (glassmorphism)
│ └── popup.js # Popup logic & stats
└── icons/
├── icon-16.png
├── icon-48.png
└── icon-128.png
AdShield uses a dual-layer approach:
- Network Layer —
declarativeNetRequestblocks ad/tracker requests before they even load (361+ rules) - Cosmetic Layer — Content scripts hide any ad elements that slip through using 100+ CSS selectors
| Category | Count | Examples |
|---|---|---|
| Ad Networks | 100+ | DoubleClick, Google Ads, Criteo, Taboola |
| Analytics & Tracking | 60+ | Google Analytics, Hotjar, Mixpanel, Segment |
| Fingerprinting | 20+ | FingerprintJS, ThreatMetrix, Permutive |
| Social Trackers | 25+ | Facebook Pixel, Twitter Analytics, LinkedIn |
| Cookie Popups | 16 | CookieBot, OneTrust, Didomi |
| Push Notification Spam | 20+ | OneSignal, PushEngage, Gravitec |
| Malware & Crypto Miners | 20 | CoinHive, CryptoLoot, JSECoin |
- Manifest V3 — Latest Chrome extension standard
- declarativeNetRequest — Efficient network-level blocking
- Content Scripts — Cosmetic filtering & feature injection
- Chrome Storage API — Persistent settings & stats
- Vanilla JavaScript — No frameworks, fast & lightweight
Contributions are welcome! Here's how:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
- Add more blocking rules
- Site-specific cosmetic filters
- Import/export settings
- Statistics charts & graphs
This project is licensed under the MIT License — see the LICENSE file for details.
If AdShield helped clean up your browsing experience, give it a ⭐ on GitHub!
Made with ❤️ by Gaurav Kumar Pandey