Button: clean up the page
On-demand action: one click hides banners, popups, chats and ads and unlocks scrolling.
Code to copy
(function () {
var SELECTORS = [
'[class*="cookie-banner"]', '[id*="cookie-notice"]',
'[class*="newsletter-popup"]', '[class*="newsletter-modal"]',
'[class*="push-notification-prompt"]', '[class*="onesignal-slidedown"]',
'[id*="intercom-container"]', '[id*="hubspot-messages-iframe-container"]',
'[class*="social-share"]', '[class*="related-posts"]',
'[class*="app-banner"]', '[class*="floating-video"]',
'[class*="anchor-ad"]', '[class*="sticky-ad"]', '.adsbygoogle'
];
var removed = 0;
SELECTORS.forEach(function (sel) {
document.querySelectorAll(sel).forEach(function (el) {
el.style.display = 'none';
removed++;
});
});
if (document.body) {
document.body.style.overflow = 'auto';
document.body.classList.remove('modal-open', 'no-scroll');
}
console.log('[JustZix] Cleanup removed ' + removed + ' element(s).');
})();
How to use this example
- Copy the code with the button above.
- Install JustZix (2 minutes) and open the extension on the target page.
- Add a new rule matching that page.
- Enable the action panel, add a button in the Actions tab and paste the code into it — run it with one click.
Rate this example
No ratings yet — be the first.