Created
October 7, 2025 05:36
-
-
Save korrio/837c9441297a8ca72be03ff337d5c2a2 to your computer and use it in GitHub Desktop.
ads-gone.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Hide images in ad containers | |
| document.querySelectorAll('[class*="ad"], [id*="ad"], [class*="banner"], [id*="banner"]').forEach(el => { | |
| el.querySelectorAll('img').forEach(img => { | |
| img.style.display = 'none'; | |
| }); | |
| }); | |
| // Also hide images with ad-related attributes | |
| document.querySelectorAll('img').forEach(img => { | |
| const allText = (img.src + img.alt + img.className + img.id).toLowerCase(); | |
| if (/ad|banner|sponsor|promo/i.test(allText)) { | |
| img.style.display = 'none'; | |
| } | |
| }); | |
| console.log('Ad images and containers hidden'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment