Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🛡️ AdShield — Your Ultimate Web Guardian

AdShield Logo

Block ads, trackers, and annoyances. Force dark mode, focus mode, and snipe any element.

Manifest V3 361+ Rules Version 2.0.0 MIT License


✨ Features

🚫 Ad & Tracker Blocking

  • 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

🌙 Force Dark Mode

  • 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

🧘 Focus Mode

  • Strip away all distractions — sidebars, comments, recommendations, floating elements
  • Centers main content for pure, distraction-free reading
  • Perfect for articles, blogs, and documentation

🎯 Element Sniper

  • 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

📊 Beautiful Stats Dashboard

  • 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

📦 Installation

From Source (Developer Mode)

  1. Download this repository:

    git clone https://github.com/YOUR_USERNAME/AdShield.git
  2. Open Chrome and go to:

    chrome://extensions/
    
  3. Enable Developer mode (toggle in top right)

  4. Click "Load unpacked"

  5. Select the AdShield folder

  6. Done! 🎉 Click the 🛡️ icon in your toolbar


🗂️ Project Structure

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

🔧 How It Works

AdShield uses a dual-layer approach:

  1. Network LayerdeclarativeNetRequest blocks ad/tracker requests before they even load (361+ rules)
  2. Cosmetic Layer — Content scripts hide any ad elements that slip through using 100+ CSS selectors

Blocking Categories

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

🛠️ Tech Stack

  • 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

🤝 Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Ideas for Contributions

  • Add more blocking rules
  • Site-specific cosmetic filters
  • Import/export settings
  • Statistics charts & graphs

📄 License

This project is licensed under the MIT License — see the LICENSE file for details.


⭐ Star This Repo!

If AdShield helped clean up your browsing experience, give it a ⭐ on GitHub!


Made with ❤️ by Gaurav Kumar Pandey

About

Chrome extension that blocks ads, trackers & annoyances with Dark Mode, Focus Mode & Element Sniper

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages