How cookie banners work, and how to screenshot a page without one
A cookie banner is a stack of layers on top of a page. Put this one together a layer at a time, then remove it three different ways and see what each one leaves behind.
A first-time visitor sees this: page dimmed, banner on top, scrolling switched off until a button is pressed.
Build it up
Then remove it
Drawn on the page, top layer first
- Banner boxOn
- Dimming overlayOn
- Scroll lockOn
- The pageDimmed
Behind the page
- Consent scriptRunning
- Stored choiceNone
What is a cookie banner made of?
A cookie banner is up to three things drawn on top of a page (a banner box, a dimming overlay and a scroll lock) and two things working behind it (a consent script and a stored choice). A screenshot shows only the first three, which is why removing the box alone often does not give a clean image.
1The page
The page on its own: what you wanted in the screenshot.
2Add the overlay
One element the size of the window, with a translucent background, dims everything under it.
3Add the banner
The banner box sits above the overlay and stays in place while the page scrolls.
4Add the scroll lock
A first-time visitor sees this: page dimmed, banner on top, scrolling switched off until a button is pressed.
| Layer | What it is | In a screenshot |
|---|---|---|
| Banner box | An element with position: fixed and a high z-index, holding the text and the buttons. | Drawn on the page |
| Dimming overlay | A second fixed element the size of the window, with a translucent background. | Drawn on the page |
| Scroll lock | overflow: hidden on html or body, usually through a class the script adds. | Drawn on the page |
| The page | The content you wanted in the screenshot. | Drawn on the page |
| Consent script | The JavaScript that draws the banner and holds other scripts back. | Behind the page |
| Stored choice | A cookie or a localStorage entry that records what the visitor chose. | Behind the page |
Three ways to remove a cookie banner, and what each leaves behind
There are three ways to keep a cookie banner out of a screenshot: hide it with CSS, block the consent script, or answer it. Each one works on a different layer, so each one has a different side effect.
1Hide it with CSS
The banner is gone, but a rule that names only the box leaves the page dimmed and locked at one screen.
- Dimming overlay
- Still there
- Scroll lock
- Still on
- Consent script
- Running
- Stored choice
- None
2Block the consent script
Nothing is drawn, so nothing needs hiding. Anything that waits for consent, such as an embedded video, stays empty.
- Dimming overlay
- Never drawn
- Scroll lock
- Never set
- Consent script
- Blocked
- Stored choice
- None
3Answer it
The site removes its own overlay and lock. Cleanest result, but the button or cookie is different on every site.
- Dimming overlay
- Removed by the site
- Scroll lock
- Released
- Consent script
- Running
- Stored choice
- Stored
| Method | How it works | What it leaves behind | Best for |
|---|---|---|---|
| Hide it with CSS | How it worksAdd a style rule that sets display: none on the banner element, found by its id or class. | What it leaves behindThe consent script still runs. If the rule names the box only, the dimming overlay and the scroll lock stay, so the page is grey and may be cut off at one screen. No choice is stored. | Best forBars, corner boxes and inline notices, which have no overlay and no lock. |
| Block the consent script | How it worksStop the request for the consent tool before it leaves the browser, so the banner is never built. | What it leaves behindNothing is drawn and nothing is stored. Content the site holds back until consent (embedded video, maps, ads) stays empty, and a site that waits for the script before it renders can show little or nothing. | Best forSites that use a well-known consent tool loaded from its own address. |
| Answer it | How it worksPress a button in the banner, or send the cookie the site would have stored after a choice. | What it leaves behindThe site removes its own banner, overlay and lock, and the choice is stored for that capture. The page then shows whatever that choice shows: after "Reject", consent-gated embeds stay off; after "Accept", ads and trackers load. | Best forCentre modals and full-screen walls, and any capture that must reflect a specific choice. |
Why does every site show a cookie banner?
Sites show a cookie banner because, in the European Union and the United Kingdom, storing or reading information on a visitor’s device needs that visitor’s consent unless the storage is strictly necessary, and consent has to be a clear action. The law does not mention banners. A banner is how sites ask. What follows quotes the texts; it is not legal advice.
“the storing of information, or the gaining of access to information already stored, in the terminal equipment of a subscriber or user is only allowed on condition that the subscriber or user concerned has given his or her consent, having been provided with clear and comprehensive information”
The rule is about storing or reading anything on a device, not about cookies by name, so localStorage and similar storage are covered too. The same paragraph exempts storage that is "strictly necessary" to provide a service the user "explicitly requested".
“‘consent’ of the data subject means any freely given, specific, informed and unambiguous indication of the data subject’s wishes by which he or she, by a statement or by a clear affirmative action, signifies agreement to the processing of personal data relating to him or her”
This definition is why a banner has buttons. Consent has to be an action, so a notice that only says "by using this site you agree" does not collect it.
“the controller shall be able to demonstrate that the data subject has consented [...] It shall be as easy to withdraw as to give consent.”
This is why the choice is stored (the site has to be able to show it) and why many sites keep a small "cookie settings" link or button on every page.
“Our consent mechanism makes it as easy to refuse consent as it is to accept. [...] Storage and access technologies are only set when valid consent is gathered, or when they meet an exception.”
The regulator expects a "reject all" beside "accept all", and nothing optional set before the click. On people who ignore the banner the same page says: "Silence or inactivity doesn’t qualify."
The ePrivacy text points to Directive 95/46/EC for the meaning of consent. That directive was repealed by the GDPR, whose Article 94(2) says that references to it “shall be construed as references to this Regulation”, so the GDPR definition is the one that applies.[2] Other countries have their own rules, and the same banner is often shown everywhere because that is simpler than telling visitors apart.
How does a cookie banner work?
A cookie banner is the visible part of a consent system with five parts: a script, the banner it draws, the choice it stores, a gate that holds other scripts back, and, on advertising-funded sites, a consent string for vendors.
In the page
In the browser’s storage
Advertising vendors, on sites that use the TCF
Consent management platform script
The consent management platform (CMP) script loads early, before other tags. It looks for a stored choice. If it finds none, it builds the banner.
Banner UI
The banner is ordinary HTML and CSS added to the page: a fixed box, often an overlay under it and a scroll lock on the page. It is the only part a screenshot shows.
Stored choice
When a button is pressed, the script writes the choice to a first-party cookie or to
localStorage. On the next visit it reads the choice and draws nothing. Each tool uses its own name and format.Tag gating
Scripts that need consent are held back, for example by a tag manager or by placeholders, and released only when the stored choice allows them. This is the part that matters legally; the banner is just its front.
TCF consent string
On sites that use IAB Europe’s Transparency and Consent Framework, the CMP also encodes the choice as a TC String and exposes it to advertising vendors through a JavaScript function named
__tcfapi. The specification leaves the storage mechanism "up to a CMP", and says that when no CMP answers, vendors "should assume" there is no consent.[4][5]
The Transparency and Consent Framework (TCF) is IAB Europe’s standard for passing a choice to advertising companies. Its page says version 2.3 was launched in April 2025.[6] The CMP API specification states: “Every consent manager MUST provide the following API function”, which is __tcfapi.[5] That detail explains one side effect of blocking: with the consent script gone, a vendor that follows the specification gets no answer and treats the visit as having no consent.
Types of cookie banner: a field key
Cookie banners come in five common shapes, and the shape tells you how much of a screenshot is lost and which removal method to reach for first.
Bottom bar
A full-width strip fixed to the bottom (sometimes the top) of the window. No overlay, the page scrolls.
- What it ruins
- A strip of the first screen. The content under it is covered, the rest is fine.
- How to remove it
- Hide it with CSS. There is nothing else to clean up.
Corner box
A small card fixed in a bottom corner. No overlay, the page scrolls.
- What it ruins
- One corner of the first screen, often on top of a chat bubble or a call to action.
- How to remove it
- Hide it with CSS.
Centre modal with overlay
A dialog in the middle, a dimming overlay over the whole page, and usually a scroll lock.
- What it ruins
- The whole screenshot: the dialog covers the middle and everything else is grey.
- How to remove it
- Answer it, or block the script. Hiding works only if the rule also covers the overlay and the lock.
Full-screen wall
The consent screen fills the window. Some sites do not load the content at all until a choice is made.
- What it ruins
- Everything. The screenshot is of the consent screen, not the page.
- How to remove it
- Answer it. Hiding the wall can leave an empty page behind it.
In-page inline notice
A notice that is part of the page flow, usually above the header. It pushes the content down.
- What it ruins
- A band at the top. Nothing is covered, but everything sits lower than it should.
- How to remove it
- Hide it with CSS. A hidden element takes no space, so the page moves back up.
How do cookie banner blocking lists work?
A cookie banner blocking list is a text file of rules, kept up by volunteers, that an ad blocker applies to every page. It holds two kinds of rule: element hiding rules, which hide anything that matches a CSS selector, and blocking rules, which work “on the network level to decide whether a request should be blocked”.[10]
Element hiding rule
###cookie-banner
##- hide elements that match
#cookie-banner- a CSS selector: the element with the id cookie-banner
On every site, an element with that id is hidden. The script that made it still runs.[8][10]
Site-specific hiding rule
example.com##.newsletter-bar
example.com- apply on this site only
##- hide elements that match
.newsletter-bar- a CSS selector: elements with this class
The same, limited to one site, so a common class name does not hide real content elsewhere.[10]
Blocking rule
-cookie-consent.js
-cookie-consent.js- a piece of a request address
Any request whose address contains that text is stopped at the network level, so the script never loads.[9][10]
| List or extension | What it is | Who maintains it | Status on 11 October 2026 |
|---|---|---|---|
| EasyList Cookie List | What it isA filter list that, in its own words, "blocks cookies banners, GDPR overlay windows and other privacy-related notices". It is also included in Fanboy’s Annoyance List. | Who maintains itThe EasyList authors. The project names four: Fanboy, MonztA, Khrin and Yuki2718. | Status on 11 October 2026Active. Its files in the EasyList repository were last changed on 2026-10-10. The general hiding file alone was 15,325 lines long and the general blocking file 986 lines.[7][8][9] |
| I don’t care about cookies | What it isA browser extension. Its site says: "In most cases, it just blocks or hides cookie related pop-ups", and that when a site needs it, the extension "will automatically accept the cookie policy for you". | Who maintains itThe extension’s site does not name an owner. The fork below states that the extension was acquired by Avast. | Status on 11 October 2026Listed for Firefox, Chrome, Edge and Opera on its site.[11][12] |
| I still don’t care about cookies | What it isA community fork of the extension above, described by its README as a "debloated fork". | Who maintains itOhMyGuus, named in the README as the current maintainer, with contributors on GitHub. | Status on 11 October 2026The repository’s latest commit was dated 2026-06-21.[12] |
List-based blocking is best effort
How to screenshot a page without the cookie banner
In CurlShot, one option applies all three methods: block_cookie_banners=true. In the online tool it is the “Hide ads and cookie pop-ups” switch. In the API it is off by default, so a plain request shows the page as a first-time visitor sees it.
CurlShot does not use the community lists. It keeps its own short list of well-known consent tools and works through the methods in order: it blocks requests to those tools, hides the containers they use and undoes their scroll-lock classes, and then, for a dialog it does not recognise, presses a button, trying “reject” wording before “accept”.
It is best effort, like every list. A small or regional consent tool may not be covered, and a home-made banner may have no button it recognises. When a button is pressed, the choice made is whichever button was found, so a screenshot that must reflect a specific choice should use click or cookies instead.
For a home-made banner, find its selector and hide it with hide_selectors, as the request here does for an element with the id site-cookie-note, or answer it with click. More in the blocking docs, and on the pages for a screenshot without cookie banners and a screenshot without ads.
curl -G "https://curlshot.com/api/v1/screenshot" \
--data-urlencode "access_key=YOUR_ACCESS_KEY" \
--data-urlencode "url=https://example.com" \
--data-urlencode "block_cookie_banners=true" \
--data-urlencode "hide_selectors=#site-cookie-note" \
--data-urlencode "full_page=true" \
--data-urlencode "delay=2" \
--output clean.pngA full-page PNG of the page with known banners cleared, one extra element hidden, and two seconds for a late banner to show up and be removed.
| Option | Method | What it does |
|---|---|---|
block_cookie_banners=true | All three, in order | Blocks requests to well-known consent tools, hides the banner containers those tools use and undoes their scroll-lock classes, then looks for a consent dialog it did not recognise and presses one of its buttons, trying "reject" wording before "accept". |
hide_selectors | Hide it with CSS | Sets display: none on every element matching your CSS selectors. Up to 50 selectors. A selector that matches nothing is not an error. |
styles | Hide it with CSS | Adds your own CSS to the page. Use it to undo what hiding leaves behind, for example html, body { overflow: auto !important } for a scroll lock. |
block_requests | Block the consent script | Blocks requests whose address matches your patterns, for a consent script the built-in list does not know. Up to 50 patterns, with * as a wildcard. |
click | Answer it | Clicks the first element matching one CSS selector before the capture, such as the banner’s reject button. If nothing clickable matches, the request fails with selector_not_found. |
cookies | Answer it | Sends cookies with the page load, in name=value form. Send the consent cookie the site stores after a choice and the banner is never shown. The name and value are specific to each site. |
delay | Timing | Waits a number of seconds before the capture. With block_cookie_banners, a banner that appeared during the wait gets a second pass. |
Hiding a banner is not consent
Hiding a cookie banner in a screenshot is about a clean image. It is not consent, and it must not be used to track people.
A capture service that visits a page is a first-time, signed-out visitor. It has made no choice, and removing the banner does not make one on anybody’s behalf. If the banner is answered with “Accept”, the site loads what that choice allows for that one visit, and that is all it means.
If a screenshot is meant as a record of what a visitor saw, leave the banner in. It was part of the page.
Checklist for a clean capture
Capture once with nothing switched on.
A capture service arrives as a first-time, signed-out visitor, so you see the banner exactly as the site shows it. Note its type from the field key.
Switch on general banner blocking.
It clears the common consent tools on most sites with one option and no site-specific work.
Check the result for the three leftovers.
A grey page (overlay still there), a full-page capture that can stop after one screen (scroll lock), and empty boxes where embeds should be (consent-gated content).
For a home-made banner, find its selector.
Open the page in a browser, right-click the banner and choose Inspect. Take the
idorclassof the outermost banner element, and of the overlay if there is one.Hide a bar, a corner box or an inline notice.
Pass the selectors to be hidden. If the page stays locked, add a style rule that restores
overflow.Answer a modal or a wall.
Click the reject or accept button by selector, or send the site’s consent cookie. Choose the button that matches what the screenshot is meant to show.
Give late banners time.
Some banners appear a second or two after load. Add a short delay so the banner exists when it is removed.
Keep it honest.
If the screenshot is a record of what a visitor saw, leave the banner in: it was part of the page.
Cookie banner glossary
- Consent
- In the GDPR, a "freely given, specific, informed and unambiguous indication" of a person’s wishes, given "by a statement or by a clear affirmative action". Hiding a banner is not consent.[2]
- Consent management platform (CMP)
- The software that shows the banner, stores the choice and tells other scripts what was chosen. IAB Europe’s specification uses CMP for the provider of that software.[5]
- TCF string (TC String)
- The encoded record of a choice in IAB Europe’s Transparency and Consent Framework. The specification says its purpose is to "encapsulate and encode all the information disclosed to a user and the expression of their preferences". It is made of segments joined by a dot.[4]
- First-party cookie
- A cookie whose domain and scheme match the page in the address bar. A consent choice is normally stored in one.[13]
- Third-party cookie
- A cookie that belongs to a different site from the page being viewed, typically set by an embedded resource such as an ad or a widget.[13]
- Overlay
- A fixed element the size of the window, drawn between the page and the banner. Usually translucent, so the page looks dimmed, and it swallows clicks.
- Scroll lock
- A style, usually
overflow: hiddenonhtmlorbody, that stops the page behind a dialog from scrolling. It is removed when the dialog is answered.
Questions people ask
Why does every website show a cookie banner?
Because in the EU and the UK a site needs the visitor’s consent before it stores or reads information on their device, unless that storage is strictly necessary for the service. The rule is Article 5(3) of the ePrivacy Directive, and the GDPR defines consent as a clear affirmative action. A banner with buttons is the usual way to ask. This is not legal advice.
How do I take a screenshot without the cookie banner?
Use one of three methods: hide the banner element with CSS, block the consent script so the banner is never built, or answer the banner by clicking a button or sending the consent cookie. In CurlShot, add block_cookie_banners=true to the request, or keep "Hide ads and cookie pop-ups" switched on in the online tool.
Why is my screenshot still grey after I hid the cookie banner?
The banner box and the dimming overlay are separate elements. A rule that hides only the box leaves the overlay in place, so the page stays dimmed. Hide the overlay element too, or answer the banner so that the site removes both itself.
Why does my full-page screenshot stop after one screen on a site with a cookie banner?
Many consent dialogs lock scrolling by setting overflow: hidden on the html or body element. Hiding the banner does not undo that. Restore it with a style rule such as html, body { overflow: auto !important }, or answer the banner so the site releases the lock.
Is hiding a cookie banner the same as accepting cookies?
No. Hiding a banner changes what is drawn and stores no choice, so it is neither consent nor refusal. Pressing "Accept" or sending an accepting consent cookie is different: the site then behaves as it does for a visitor who accepted, and loads what that choice allows.
Does cookie banner blocking work on every site?
No. Blocking by list is best effort, in ad blockers and in screenshot services alike. A list covers the consent tools and class names someone has added to it. A home-made banner or a renamed element is missed until you hide it by its own selector or click its button.
What is the IAB TCF consent string?
It is the TC String of IAB Europe’s Transparency and Consent Framework: an encoded record of what a visitor was told and chose, made of segments joined by a dot. A consent tool that follows the framework exposes it to advertising vendors through a JavaScript function named __tcfapi.
Sources
- [1]EUR-Lex, Directive 2002/58/EC (Directive on privacy and electronic communications), consolidated text of 19 December 2009, Article 5(3). Checked .
- [2]EUR-Lex, Regulation (EU) 2016/679 (General Data Protection Regulation), Articles 4(11), 7 and 94(2). Checked .
- [3]Information Commissioner’s Office (UK), Guidance on the use of storage and access technologies: How do we manage consent in practice?. Checked .
- [4]IAB Tech Lab and IAB Europe, on GitHub, Transparency and Consent String with Global Vendor and CMP List Formats (TCF v2). Checked .
- [5]IAB Tech Lab and IAB Europe, on GitHub, Consent Management Platform API v2 (TCF). Checked .
- [6]IAB Europe, Transparency and Consent Framework. Checked .
- [7]EasyList, EasyList: overview of the filter lists and their authors. Checked .
- [8]EasyList, on GitHub, EasyList Cookie List: general element hiding rules (easylist_cookie_general_hide.txt). Checked .
- [9]EasyList, on GitHub, EasyList Cookie List: general blocking rules (easylist_cookie_general_block.txt). Checked .
- [10]Adblock Plus Help Center, How to write filters. Checked .
- [11]i-dont-care-about-cookies.eu, I don’t care about cookies. Checked .
- [12]OhMyGuus, on GitHub, I still don’t care about cookies: README. Checked .
- [13]MDN Web Docs, Third-party cookies. Checked .
Read next
- Field guideWhy website screenshots look wrong, and the fixesA field guide to 11 ways a website screenshot goes wrong, from blank lazy images to cookie banners and cut-off pages, with the cause and the fix for each.
- ChecklistCapture a web page as evidence that holds upA checklist for saving a web page as a credible record: what to capture, how to fix the time with a hash and timestamp, and what makes a screenshot weak.
- GuideHow to screenshot a page behind a login, safelyFour ways to screenshot a page that needs a login: session cookie, bearer token, Basic auth or a signed link. What each one risks, and the safest pattern.