← All examples

Action Ads & clutter

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

  1. Copy the code with the button above.
  2. Install JustZix (2 minutes) and open the extension on the target page.
  3. Add a new rule matching that page.
  4. 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.

Does this example work?

Snippets are useless without somewhere to paste them.

JustZix takes 2 minutes to install and runs your code on every matching page. No account, no payment.

Download free See use cases