A powerful Chrome extension that blocks full-screen ad overlays and malicious redirect/popup ads using intelligent detection algorithms.
- Smart Overlay Blocking: Uses heuristic scoring to detect and remove full-screen ad overlays while preserving legitimate site modals
- Popup Prevention: Blocks popup ads and popunders by intercepting
window.open()calls - Redirect Protection: Prevents malicious redirects from ad networks and suspicious links
- Whitelist Management: Easily add/remove sites from whitelist to support your favorite websites
- Real-time Statistics: Track how many ads have been blocked (overlays, popups, redirects)
- User-Friendly Interface: Clean popup UI with toggle controls and statistics display
- Manifest V3 Compliant: Built with the latest Chrome extension standards
- Open
icons/generate-icons.htmlin your browser - Click "Generate Icons" button
- Right-click each generated icon and save as:
- Small icon →
icon16.png - Medium icon →
icon48.png - Large icon →
icon128.png
- Small icon →
- Save all three files in the
icons/folder
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" (toggle in top-right corner)
- Click "Load unpacked"
- Select the
AdsBlockfolder - The extension should now appear in your extensions list!
- Click the AdBlock Shield icon in your Chrome toolbar
- The extension is enabled by default and will automatically block ads
- View blocking statistics in the popup
- Navigate to the website you want to whitelist
- Click the AdBlock Shield icon
- Click "Add to Whitelist"
- The page will reload and ads will no longer be blocked on that site
- Click the AdBlock Shield icon
- Toggle the switch at the top to disable
- Toggle again to re-enable
- Click the AdBlock Shield icon
- Click "Clear Statistics" button at the bottom
The extension uses a scoring system to identify ad overlays:
- Z-index check: High z-index values (>999) indicate overlays
- Position check:
position: fixedorabsoluteelements - Dimensions check: Full-screen or near-full-screen elements
- Keyword detection: Ad-related class names/IDs
- Ad network detection: Iframes from known ad networks
Elements scoring >60 points are classified as ad overlays and removed.
The extension blocks suspicious links based on:
- External links with
target="_blank"and suspicious patterns - Links to known ad networks (doubleclick.net, googlesyndication.com, etc.)
- Links with tracking parameters (utm_, fbclid, gclid)
- onclick handlers that call
window.open() - Rapid-fire popup attempts (<500ms between clicks)
- Uses MutationObserver for efficient DOM monitoring
- Scans for new overlays only when relevant elements are added
- Periodic fallback scans every 5 seconds
- Event delegation for link click monitoring
AdsBlock/
├── manifest.json # Extension configuration (Manifest V3)
├── background.js # Service worker for state management
├── content.js # Main ad blocking logic
├── utils.js # Shared utilities and detection algorithms
├── popup.html # Popup interface
├── popup.css # Popup styling
├── popup.js # Popup logic
├── icons/ # Extension icons
│ ├── icon16.png
│ ├── icon48.png
│ ├── icon128.png
│ ├── icon.svg # Source SVG
│ └── generate-icons.html # Icon generator tool
└── README.md # This file
- Service worker background script
- Content scripts with proper permissions
- Chrome storage API for settings persistence
- Message passing between scripts
storage: Save settings and statisticsactiveTab: Access current tab informationscripting: Inject content scriptstabs: Manage tab state<all_urls>: Run on all websites
{
enabled: true/false,
whitelist: ['example.com', 'trusted-site.com'],
stats: {
overlaysBlocked: 0,
popupsBlocked: 0,
redirectsBlocked: 0
}
}- Cannot block ads on Chrome internal pages (chrome://, chrome-extension://)
- Some sophisticated ad networks may bypass detection
- Extremely fast redirects may not be caught in time
- Cannot close popup windows opened by the browser itself
- Make sure the extension is enabled (check toggle in popup)
- Verify the site is not whitelisted
- Try refreshing the page after enabling the extension
- Check browser console for any errors
- Add the site to the whitelist
- The moderate detection approach should minimize false positives
- Report persistent issues by checking console logs
- Refresh the popup by closing and reopening it
- Statistics update every 2 seconds when popup is open
- Check if the extension is properly loaded in
chrome://extensions/
- No data is collected or sent to external servers
- All blocking happens locally in your browser
- Settings are stored using Chrome's sync storage (synced across devices)
- No tracking, no analytics, no external connections
- Chrome 88+ (Manifest V3 support required)
- Chromium-based browsers (Edge, Brave, Opera) with Manifest V3 support
- Smart overlay detection and blocking
- Popup and redirect prevention
- Whitelist management
- Statistics tracking
- User-friendly popup interface
For issues, feature requests, or contributions, please check the console logs for debugging information.
This extension is provided as-is for personal use.
Note: This extension is designed for defensive security purposes only. It blocks intrusive ads that harm user experience while respecting legitimate website functionality.