A lightweight Chrome extension that allows you to dynamically remove unwanted elements from web pages using customizable CSS selectors.
- Custom CSS Selectors: Remove elements using any valid CSS selector
- Domain Exclusion: Exclude specific domains or URLs from ad removal
- Real-time Monitoring: Automatically removes dynamically loaded ads using MutationObserver
- Simple Configuration: Easy-to-use popup interface for managing settings
- Persistent Settings: Your configurations are saved and synced across devices
(Coming soon)
- Download or clone this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right corner
- Click "Load unpacked" and select the extension directory
- The Dynamic Ad Remover extension should now appear in your extensions list
- Click the extension icon in your browser toolbar to open settings
- In the "Selectors" textarea, add CSS selectors (one per line) for elements you want to remove
- Examples of common selectors:
div#ad .advert ins.adsbygoogle [data-testid*="ad"] .sponsored-content iframe[src*="googleads"]
- In the "Exclude Domains/Hosts" textarea, add domains or URLs you want to exclude from ad removal
- Examples:
dev.azure.com github.com stackoverflow.com/questions/specific-page
- Configure your selectors and exclusions (see above)
- Click "Save" to store your settings
- Navigate to any webpage where you want to remove ads
- Click the extension icon to activate ad removal on that specific tab
- The extension will remove elements matching your selectors and monitor for new ones
- Click the "Save" button to apply your changes
- The extension will automatically start working on applicable websites
The extension uses three main components:
- Content Script (
content.js): Runs on every webpage and removes elements matching your selectors - Popup Interface (
popup.html+popup.js): Provides the configuration interface - Manifest (
manifest.json): Defines extension permissions and structure
- Uses Manifest V3 for modern Chrome extension compatibility
- Employs MutationObserver to catch dynamically loaded content
- Stores settings using Chrome's sync storage API
- Supports complex CSS selectors and domain-based exclusions
/* Google Ads */
ins.adsbygoogle
div[data-google-query-id]
/* Generic ad containers */
.ad-container
.advertisement
.sponsored
[class*="ad-"]
[id*="ad-"]
/* Social media promoted content */
[data-testid="placementTracking"]
[aria-label*="Sponsored"]# Exclude entire domains
example.com
dev.azure.com
# Exclude specific paths
github.com/settings
stackoverflow.com/questions
The extension requires the following permissions:
- storage: To save your selector and exclusion settings
- scripting: To inject content scripts that remove unwanted elements
- activeTab: To access the current tab when you click the extension icon
- All settings are stored locally in your browser
- No data is transmitted to external servers
- The extension only processes the CSS selectors and domains you configure
- Fork this repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Initial release
- Basic CSS selector-based element removal
- Domain exclusion functionality
- Popup configuration interface
- Real-time content monitoring
If you encounter any issues or have suggestions for improvements, please open an issue on GitHub.
This extension is designed for educational purposes and personal use. Please respect website terms of service and consider supporting content creators through legitimate means.