# Ads, popups, chat bubbles: before and after

> Ten test pages with an ad, a chat bubble, cookie bars and popups, each captured before and after, with the option that removed it and what it cost.

Before and after by Serghei Pogor, founder of CurlShot (https://curlshot.com/about/serghei-pogor). Published 26 November 2026. Page for people: https://curlshot.com/blog/overlays-before-after-screenshots

To screenshot a page without ads, popups or chat bubbles, switch on the block option that matches the overlay (block_ads, block_trackers, block_chats, block_cookie_banners) and hide anything the lists do not know with hide_selectors. In 10 local test pages CurlShot removed a consent wall, a chat bubble and a script-made banner cleanly, block_ads alone left a 274 px hole, a floating cookie bar slipped past block_cookie_banners in an 800 px window, and a newsletter popup on no list needed hide_selectors or block_requests.

## Key facts

- An overlay leaves a screenshot in one of three ways: its script is never fetched (block_ads, block_trackers, block_chats, block_cookie_banners, block_requests), CSS hides it (hide_selectors, styles), or a sweep finds it and hides it or presses its button (block_cookie_banners).
- Stopping a request does not close the room the overlay reserved. With block_ads alone the test page stayed 1,359 px tall, a 274 px hole. Adding hide_selectors for the slot made it 1,085 px.
- A cookie bar fixed 16 px above the bottom edge was hidden in a 1280 x 1024 window and missed in a 1280 x 800 one, because the sweep probes 25 points of the window: none fell on the bar at 800 px of height, five did at 1024. hide_selectors with its id removed it at both heights.
- On a page with nothing to remove, block_cookie_banners added 85 ms to the median render (12 alternating rounds, 1,576 to 1,661 ms). Blocking ads, trackers and chats added nothing beyond noise.
- A newsletter popup that is on no list went away with hide_selectors (the modal and its backdrop) or with block_requests and a piece of the script's address. The second also stops the script from loading.
- block_trackers changes no pixel. It stops the beacon, so the capture does not show up as a visit in the site's statistics.

## Ten overlays, before and after

Each card is one test page: the same tide-table article with one overlay added, captured before and after the option. "Pixels changed" is the share of the picture that differs from the before picture; when the page moves up, text moves with it and the share is large.

### Consent wall

A full-screen dark layer with a privacy card in the middle. The page behind it is locked: scrolling is switched off on html and body. Page height before: 1,085 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `block_cookie_banners=true` | Removed cleanly | 95.7% | 1,085 px | 0 | Nothing was lost in this run. The full-page picture is 1,085 px tall, the same as with the wall. Nothing is clicked on this card, so no consent choice is made. |
| `hide_selectors=#gate` | Removed cleanly | 95.7% | 1,085 px | 0 | You need the id, and it stops working if the site renames it. The scroll lock is not lifted, yet the full-page picture came out the same height, 1,085 px. |

- `block_cookie_banners`: The sweep finds a fixed layer with consent wording and a button, sets display: none on it and, because it covers more than half the window, lifts the scroll lock.
- `hide_selectors`: CSS display: none on the layer you named by its id.

### Banner ad

A 250 px slot between the intro and the three cards. A script whose address matches the ad patterns fills it with a banner. Page height before: 1,359 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `block_ads=true` | Removed, but a gap is left | 18.3% | 1,359 px | 1 | The slot keeps its 250 px. The page is still 1,359 px tall, so a 274 px hole stays where the ad was. |
| `block_ads=true&hide_selectors=.ad-slot` | Removed cleanly | 49.9% | 1,085 px | 1 | You need the slot's class. The page is 1,085 px tall, 274 px shorter, and everything under the ad moves up. |

- `block_ads`: The ad script is on the list, so its request is stopped and the banner is never drawn.
- `block_ads + hide_selectors`: The request is stopped, and CSS display: none takes the empty slot out of the layout.

### Chat bubble

A script that adds a greeting box and a round button, fixed to the bottom right corner. Page height before: 1,085 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `block_chats=true` | Removed cleanly | 1.9% | 1,085 px | 1 | None seen. The 1.9% of pixels that changed are the bubble, and the page height stayed 1,085 px. It only works for a widget loaded from an address on the list. |

- `block_chats`: The widget script is on the list, so it is never fetched and nothing is mounted.

### Consent tool banner

A script named like a well-known consent tool's loader makes a bottom banner with Reject all and Accept all buttons. Page height before: 1,085 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `block_cookie_banners=true` | Removed cleanly | 9.2% | 1,085 px | 1 | Nothing is clicked: the script never ran, so no consent choice is made. 9.2% of pixels changed, all of it the banner. |

- `block_cookie_banners`: The loader is on the consent list, so its request is stopped and the banner is never made.

### Home-made cookie bar

A dark bar in the page's own markup, fixed 16 px above the bottom edge, with text about cookies and the buttons Accept all and Settings. No known script, no known class. Page height before: 1,085 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `block_cookie_banners=true` | Removed cleanly | 7.3% | 1,085 px | 0 | About 0.1 s when a page has nothing to hide (measured below). It depends on the window height: see the next card. |

- `block_cookie_banners`: No request to stop. The sweep finds a fixed box with cookie wording and a button and hides it. Its markup carries no consent name, so by the source the click step skips it and the hide step takes it.

### Same bar, 800 px window

The same bar, captured in a 1280 x 800 window instead of 1280 x 1024. Page height before: 1,085 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `block_cookie_banners=true` | Not removed | 0% | 1,085 px | 0 | The bar is still there: 0.0% of pixels changed and no request was stopped. |
| `hide_selectors=#notice` | Removed cleanly | 9.5% | 1,085 px | 0 | You need the id, and it stops working if the site renames it. It worked at 800 px, and the same rule is safe at any height. |

- `block_cookie_banners`: The sweep looks at 25 points: 2, 25, 50, 75 and 98% of the window width, at the same five heights. At 800 px the lowest row is 784 px down, the bar's own bottom edge, so none of the 25 points lands on the bar (5 of 25 do at 1024 px) and nothing is found.
- `hide_selectors`: CSS display: none on the bar's id. It does not look at the window.

### Bar that comes late

A full-width bar that a script adds 700 ms after the load event. These pictures were taken with delay=1, so the bar is in the first one. Page height before: 1,085 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `block_cookie_banners=true` | Removed cleanly | 5.7% | 1,085 px | 0 | That wait applies to every page where the first sweep finds nothing. On a page with no banner at all, the median render was 85 ms longer. |
| `block_cookie_banners=true&delay=1` | Removed cleanly | 5.7% | 1,085 px | 0 | delay adds its full wait, 1 s here, to every render, banner or not. |

- `block_cookie_banners`: When the first sweep finds nothing, the renderer waits up to 1 s after the load event for a late banner, and an observer keeps hiding for 15 s. Here it caught the bar.
- `block_cookie_banners + delay`: A second sweep runs after the delay, for a banner that arrives later than the first wait.

### Newsletter popup

A script adds a modal and a dark backdrop 400 ms after load and switches scrolling off. It is on no list. Both pictures were taken with delay=1. Page height before: 1,085 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `delay=1&hide_selectors=#join-modal,.join-backdrop` | Removed cleanly | 96.2% | 1,085 px | 0 | The popup script still loads and runs, and you need both selectors. The page height did not change, 1,085 px. |
| `delay=1&block_requests=join-popup` | Removed cleanly | 96.2% | 1,085 px | 1 | You need a piece of the script's address, found in the browser's Network tab. One request stopped, and the page is otherwise untouched. |

- `hide_selectors`: CSS display: none on the modal and on its backdrop, two selectors.
- `block_requests`: A pattern with no star matches any address that contains the text, so the popup script's request is stopped and nothing is mounted.

### Sticky promo bar

A 56 px bar fixed to the top of the window. The page has 56 px of padding at the top so the bar does not cover the header. Page height before: 1,141 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `hide_selectors=.promo-bar` | Removed, but a gap is left | 5.4% | 1,141 px | 0 | The 56 px of room stays: a blank strip at the top, and a page 1,141 px tall instead of 1,085. |
| `hide_selectors=.promo-bar&styles=body{padding-top:0!important}` | Removed cleanly | 37.5% | 1,085 px | 0 | A second rule to know about and to keep in step with the site. The page is 1,085 px tall. |

- `hide_selectors`: CSS display: none takes the bar out.
- `hide_selectors + styles`: The second rule removes the padding the bar needed.

### Tracking script

An analytics script that sends one beacon and draws nothing. Page height before: 1,085 px.

| Option | Result | Pixels changed | Page height after | Requests stopped | What it costs |
| --- | --- | --- | --- | --- | --- |
| `block_trackers=true` | Nothing to see: the picture did not change | 0% | 1,085 px | 1 | No cost, and no visible gain: 0.0% of pixels changed. The gain is that the capture sends no visit to the site's statistics. |

- `block_trackers`: The script is on the tracker list, so its request is stopped. The beacon it would have sent never leaves.

## Three ways an overlay goes away

| Way | Options | Works when | Fails when |
| --- | --- | --- | --- |
| Stop the request | block_ads, block_trackers, block_chats, block_cookie_banners, block_requests, block_resources | The overlay is made by a script or a file the page fetches. If the file never arrives, nothing is drawn. | The overlay is in the page's own markup, or comes from an address that is on no list and that you have not named. The space it reserved stays. |
| Hide it with CSS | hide_selectors, styles | You can name the element. display: none takes it out of the layout, as if it were not there. | The script still runs and may draw it again under another name. Whatever room the page made for it stays unless a second rule gives it back. |
| Find it and press the button | block_cookie_banners | A consent banner of a known tool, or a home-made one that is fixed to the window and talks about cookies. | A bar that no probe point touches, a banner with no button the code recognises, or a popup that is not about consent. |

CSS `position: fixed` keeps an element in the same place relative to the viewport when the page scrolls, which is why overlays use it. `display: none` takes an element out of the layout as if it were not there, which is why hiding the container closes the gap.

## What the options cost on a clean page

Median render time of a page with nothing to remove, 12 rounds, the four option sets in turn:

| Options | Median | Fastest | Slowest |
| --- | --- | --- | --- |
| No blocking options | 1,576 ms | 1,407 ms | 1,757 ms |
| block_cookie_banners | 1,661 ms | 1,564 ms | 2,027 ms |
| block_ads, block_trackers, block_chats | 1,553 ms | 1,402 ms | 2,139 ms |
| All four | 1,667 ms | 1,514 ms | 1,999 ms |

The machine was busy with other work, so read these as an order of size.

## One request that uses all of it

```bash
curl -G "https://curlshot.com/api/v1/screenshot" \
  --data-urlencode "access_key=YOUR_ACCESS_KEY" \
  --data-urlencode "url=https://example.com/article" \
  --data-urlencode "block_ads=true" \
  --data-urlencode "block_trackers=true" \
  --data-urlencode "block_chats=true" \
  --data-urlencode "block_cookie_banners=true" \
  --data-urlencode "hide_selectors=.ad-slot,.promo-bar,#join-modal,.join-backdrop" \
  --data-urlencode "styles=body{padding-top:0!important}" \
  --data-urlencode "delay=1" \
  --output clean.png
```

Swap the selectors for the ones on your page. The Network tab of your browser lists the requests to put in block_requests.

## How it was run

12 November 2026. Chromium 153.0.8010.12 through Playwright 1.63.0. Ten small pages, each the same tide-table article with one overlay added, were served from a local web server and rendered by the capture renderer process of the product with the options named on each card. Each case was rendered five times and once more as a full-page capture to read the page height. The window is 1280 x 1024, the default, except where a card says 800. No call to the public API was sent: the renderer process of CurlShot was driven directly. Pages you capture have their own scripts and timing, so your result may differ.

## Questions

### How do I take a screenshot without ads?

Add block_ads=true to the request. CurlShot then stops requests to known ad networks before they leave the browser, so the ad is never drawn. The space the ad would have filled can stay empty; in the test it was a 274 px hole. Add hide_selectors with the class of the ad slot to close it.

### How do I remove a cookie banner from a screenshot?

Add block_cookie_banners=true. It stops the scripts of well-known consent tools, hides their banner layouts, presses a button in a consent dialog it finds, and hides fixed overlays that carry cookie wording. For a banner it misses, hide_selectors with its id or class removes it.

### Why does the cookie banner still show on my capture?

The sweep that finds home-made banners probes 25 points of the window. A bar that floats clear of the window's edge can fall between them: in the test, a bar 16 px above the bottom was missed at 800 px of height and hidden at 1024. Hide it by id or class with hide_selectors, which does not depend on the window.

### Why is there blank space where the ad or the bar was?

Blocking stops the file, not the layout. If the page reserved room for the element, with a fixed height, a margin or padding, that room stays. Hide the container with hide_selectors, and for a fixed top bar add a styles rule that removes the padding the page made for it.

### Does blocking chat widgets or trackers change the screenshot?

Blocking a chat widget removes its bubble and nothing else in the test. Blocking a tracker changed no pixel at all: it stops the analytics beacon, so the capture does not count as a visit. Both only work for scripts loaded from an address on the list.

### Do the block options make a capture slower?

Not by much. On a page with nothing to remove, block_cookie_banners added 85 ms to the median render in 12 alternating rounds, and blocking ads, trackers and chats added nothing beyond noise. delay is different: it adds its full wait every time. The test ran on a busy machine, so read the numbers as an order of size.

## Sources

1. MDN Web Docs, "position": https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position (checked 12 November 2026)
2. MDN Web Docs, "display": https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/display (checked 12 November 2026)

## Go deeper

- [Screenshot without ads](https://curlshot.com/tools/screenshot-without-ads)
- [Screenshot without cookie banners](https://curlshot.com/tools/screenshot-without-cookie-banners)
- [Blocking ads, cookie banners, trackers and chats](https://curlshot.com/docs/blocking)
- [Custom CSS, JavaScript and clicks](https://curlshot.com/docs/customize)

## Read next

- [How cookie banners work, and how to hide them](https://curlshot.com/blog/how-cookie-banners-work.md): A cookie banner taken apart layer by layer: why sites show one, how it works, and three ways to remove it from a screenshot, with what each leaves behind.
- [CSS selectors for element screenshots](https://curlshot.com/blog/css-selectors-for-element-screenshots.md): Type a CSS selector, see what it matches on a specimen page and what a capture returns. With a cheat sheet, a robustness ranking and fixes.
- [Why website screenshots look wrong, and the fixes](https://curlshot.com/blog/why-website-screenshots-look-wrong.md): A 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.
