Link Search Menu Expand Document

Blocking cookie banners

Learn how to block cookie banners with taking screenshots


How it works

The easiest way to hide cookie banners in your screenshots is by injecting CSS into your image to hide them.

Any CSS passed via the css param when generating a URL image will get injected into the page.

The hard part can be figuring out what CSS to use to block the cookie banner. To do this, we recommend visiting the site in Chrome. Use the developer tools inspector to find the ID or CSS class of the cookie banner (the css selector).

Then use this information to override the visibility of the cookie banner.

Here is an example that hides some common cookie banner.s

#onetrust-consent-sdk {
 display: none !important;
}

.qc-cmp2-container {
   display: none !important;
}

To learn about CSS Selectors, we recommend this article.


Need help?

Talk to a human. Please email us support@htmlcsstoimage.com with any questions and we’ll gladly help you get started.


Back to top

Built with extensive integration tests and serious care for developer happiness.
© 2018-2024 Code Happy, LLC.

Page last modified: Apr 9 2024 at 11:04 PM.

Edit this page on GitHub.