A privacy-focused Chrome extension that blocks intrusive ads and malicious content with real-time statistics, per-domain controls, and a beautiful light/dark theme UI.
ADs/
├── extension/ # Extension files
│ ├── manifest.json # Extension configuration
│ ├── background.js # Ad-blocking engine
│ ├── content.js # Real-time tracking
│ ├── popup/ # Extension popup UI
│ ├── dashboard/ # Statistics dashboard
│ ├── login.html # Login page
│ ├── signup.html # Signup page
│ ├── server.js # Backend API
│ ├── package.json # Dependencies
│ └── routes/ # API routes
│
├── website/ # Marketing website
│ ├── index.html # Single-page website
│ ├── styles.css # Responsive styling
│ ├── script.js # Installation logic
│ └── README.md # Website docs
│
├── README.md # This file
└── AUTH_SETUP.md # Authentication guide
Ad Blocking
- Blocks major ad networks (Google, Doubleclick, Taboola, Outbrain, Criteo, etc.)
- Blocks generic tracking patterns and malware delivery networks
- YouTube & video platform protection (doesn't interfere with video playback)
Real-Time Statistics
- View today's blocked ads in the popup
- Total blocked ads across all time
- Historical stats tracking (last 14 days)
- Visual charts and analytics in dashboard
Domain Controls
- Enable/disable protection globally with one click
- Per-domain whitelisting/blacklisting
- Toggle protection for individual websites
- Persistent settings across sessions
Theme Support
- Beautiful dark mode (default)
- Professional light mode
- Remembers your preference
Authentication System
- Login/signup pages with backend API
- Chrome Storage integration
- Demo credentials:
admin/admin
# Navigate to extension folder
cd extension
# Install dependencies
npm install
# Start backend API
npm startThe API will run on http://localhost:3000
Then load the extension:
- Open Chrome and go to
chrome://extensions/ - Enable Developer Mode (top right toggle)
- Click Load unpacked
- Select the
extension/folder - Extension is now active!
cd website
python -m http.server 8000
# Open: http://localhost:8000The website showcases the extension and provides installation guides.
- Chrome browser (version 114+)
- Node.js (for running the backend API)
- npm or yarn
git clone <repository-url>
cd ADscd extension
npm installThis installs:
express- Web frameworkcors- Cross-Origin Resource Sharing middleware
npm start
# or
node server.jsThe API will run on http://localhost:3000 with these endpoints:
POST /api/auth/signup- Register new userPOST /api/auth/login- Login userGET /api/auth/me- Get current user infoGET /health- Health check
- Open Chrome and go to
chrome://extensions/ - Enable Developer Mode (toggle in top right)
- Click Load unpacked
- Select the
extension/folder - The CleanAdsSurf extension will appear in your extensions list
Option A: Via Popup Menu
- Click the CleanAdsSurf icon in your Chrome toolbar
- The popup shows statistics and per-domain controls
- Toggle protection on/off or configure individual sites
Option B: Via Dashboard
- Click the CleanAdsSurf icon → "Options" (or right-click → Options)
- Opens the full dashboard with advanced controls
- View historical charts, manage all domain settings
Option C: Via Login Page
- Click the CleanAdsSurf icon
- Select "Login" to go to the authentication page
- Use demo credentials:
[email protected]/admin - After login, you're taken to the popup dashboard
- Open any website - ads will automatically be blocked
- Click the CleanAdsSurf icon to see statistics
- View real-time stats:
- Today's blocked ads
- Total blocked ads (all time)
- Current domain status
| Button | Function |
|---|---|
| Global Toggle | Enable/disable protection for all websites |
| Domain Toggle | Whitelist/blacklist current domain |
| Refresh | Manually refresh statistics |
| Theme Toggle | Switch between dark and light mode |
Access the full dashboard for advanced control:
- Global Protection - Master on/off switch
- Domain Management - Manage individual site permissions
- Statistics View - Detailed charts and history
- Theme Settings - Dark/light mode preference
- Historical Data - Last 14 days of blocking stats
Username: admin
Email: [email protected]
Password: admin
- Click CleanAdsSurf icon → Click "Login"
- Enter credentials (or create new account)
- Backend validates and stores in Chrome Storage
- User info persists across sessions
- Login:
login.html- Sign in with existing credentials - Signup:
signup.html- Create new account - Backend:
server.js+routes/auth.js- API endpoints
ADs/
├── manifest.json # Extension configuration
├── background.js # Service worker (ad blocking logic)
├── content.js # Content script
├── server.js # Backend API server
├── package.json # Node dependencies
├── auth.css # Auth page styling
├── login.html # Login page
├── signup.html # Signup page
├── login.js # Login logic
├── signup.js # Signup logic
├── popup/
│ ├── popup.html # Popup UI
│ ├── popup.js # Popup logic
│ └── popup.css # Popup styling
├── dashboard/
│ ├── dashboard.html # Dashboard UI
│ ├── dashboard.js # Dashboard logic
│ └── dashboard.css # Dashboard styling
├── routes/
│ └── auth.js # Authentication endpoints
├── assets/
│ ├── icon16.png # Extension icon 16x16
│ ├── icon48.png # Extension icon 48x48
│ └── icon128.png # Extension icon 128x128
├── data/
│ └── stats.json # Sample data
└── AUTH_SETUP.md # Detailed authentication guide
The extension blocks:
doubleclick.net- Google Adsgooglesyndication.com- Google ad syndicationadservice.google.com- Google ad serviceadsafeprotected.com- Ad safetytaboola.com- Content recommendation adsoutbrain.com- Content recommendation adscriteo.com- Retargeting adsscorecardresearch.com- Tracking- Generic patterns:
*adtrack*,*://*/ads/*
malwaredelivery.comransomwaretracker.com*.exefiles*.apkfiles
- YouTube, youtu.be, m.youtube.com - Whitelisted (not blocked)
- googlevideo.com, videodelivery.net - Whitelisted (video delivery)
Error: "Failed to load extension"
Solution:
- Check
manifest.jsonis valid JSON - Ensure
background.jshas no syntax errors - Run:
node -c background.jsto validate - Check Chrome console (F12) for detailed error
Error: Videos buffer but don't start
Solution:
- [+] Already fixed! YouTube domains are whitelisted
- Disable extension and reload page to test
- Check popup to ensure "Global Protection" is enabled
Error: "Unable to reach server"
Solution:
- Ensure backend is running:
npm start - Backend must run on
http://localhost:3000 - Check backend console for errors
- Verify CORS is enabled in
server.js
Error: "0 ads blocked" even on ad-heavy sites
Solution:
- Ensure extension is enabled in popup
- Hard refresh page (Ctrl+Shift+R or Cmd+Shift+R)
- Check extension permissions:
- Go to
chrome://extensions/CleanAdsSurf/Details - Verify "Allow on all sites" is enabled
- Go to
- Check background.js service worker in DevTools
Error: Statistics show but don't increment
Solution:
- Click "Refresh" button in popup
- Check that
declarativeNetRequestAPI is working:- Open DevTools (F12)
- Go to Console tab
- Check for API errors
- Verify rule IDs don't conflict (1-8, 20-21, 40-43)
- Open
chrome://extensions/ - Find CleanAdsSurf
- Click Details
- Under "Service Worker", click Inspect to debug background.js
- Under "inspect views", click popup to debug popup.js
Validate ad-blocking rules:
node test-rules.jsTest backend endpoints:
# Health check
curl http://localhost:3000/health
# Login
curl -X POST http://localhost:3000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"usernameOrEmail":"admin","password":"admin"}'
# Signup
curl -X POST http://localhost:3000/api/auth/signup \
-H "Content-Type: application/json" \
-d '{"username":"test","email":"[email protected]","password":"pass","confirmPassword":"pass"}'- Lightweight: Minimal JS, efficient CSS
- Fast blocking: Declarative Net Request API (Chrome native)
- Low memory: Service worker only loads on demand
- Optimized rules: 14 core rules, no regex complexity
- No tracking: No external API calls
- Local storage only: All data stays in Chrome Storage
- No logs: Activity not sent anywhere
- Open source: Review the code yourself
- Chrome 114+ (Manifest V3)
- Brave, Edge, and other Chromium-based browsers
- Real database (MongoDB/PostgreSQL)
- JWT token authentication
- Password hashing (bcrypt)
- Email verification
- Custom rule creation
- Whitelist/blacklist management UI
- Export statistics
- Dark web monitoring integration
MIT License - See LICENSE file for details
For issues, bugs, or feature requests:
- Check the Troubleshooting section above
- Review
AUTH_SETUP.mdfor auth-specific help - Check Chrome DevTools console for error messages
- Ensure backend is running on port 3000
CleanAdsSurf - Clean browsing. Your privacy matters.