A tiny bookmarklet to remove ads from any website.
No extensions. No installs. Just drag, click, and read.
- 🧩 Works on any website
- ⚡ Instant ad hiding via CSS
- 🔄 Removes dynamic ads with JavaScript
- 🧠 Uses
MutationObserverto catch ads loaded after page load - 🧪 Two modes:
- Normal Mode → clean ads without breaking layout
- 🔥 Beast Mode → removes everything (aggressive)
- Go to the project page
- Drag the button to your bookmarks bar
- Open any website
- Click your bookmark
- Enjoy a clean reading experience
Refresh the page (F5) to restore everything.
When you trigger the bookmarklet, it injects:
- A CSS file → hides common ad containers instantly
- A JavaScript file → removes dynamic ads and prevents them from reappearing
Modern websites inject ads dynamically after page load.
To handle this, Hide Ads uses:
MutationObserverThis allows:
- Detecting new nodes added to the DOM
- Removing ads in real-time
- Fighting back against JS-based ad reloads
- Removes most ads
- Keeps layout mostly intact
- Removes iframes, embeds, sponsored blocks, and more
- Designed for news sites and heavy ad pages
- May break layouts (by design)
/assets
style.css
js.js
style-aggressive.css
js-aggressive.js
This project is intentionally simple.
- No browser APIs
- No extensions
- No permissions
- No tracking
Just pure client-side DOM manipulation.
Part of the original idea (since 2018) was to fight back against websites that:
- Reload ads dynamically via JavaScript
- Re-inject ads after user interaction
- Continuously mutate the DOM
- Detect DOM changes
- Intercept injected elements
- Remove unwanted nodes instantly
- Detecting DOM changes
- How JavaScript works: tracking changes in the DOM using MutationObserver
- StackOverflow discussions on DOM mutation detection
- Improve detection heuristics
- Smarter "auto mode" (detect news sites)
- Performance optimizations
- Better selector tuning
- Annual updates (keep up with modern web changes)
If you find ads that are not removed:
👉 Open an issue: https://github.com/SidVal/hide-ads/issues
Include:
- URL
- Screenshot (if possible)
- Description of the ad
This tool removes elements from the DOM after the page loads.
It does not block network requests like browser extensions (e.g. uBlock Origin).
Some websites may break when using aggressive mode.
PRs and ideas are welcome.
This project evolves with the web.
MIT