Back to blog
EngineeringBlockingPerformanceRendering

Blocking cookie banners, ads and trackers without breaking the page

How the block option works under the hood, why cookie banners are hidden with CSS instead of network rules, and when you should turn blocking off.

Thien Nguyen
Thien Nguyen
Creator & Maker
· Aug 19, 2026· 2 min read

The fastest way to ruin a screenshot is a consent dialog covering half the page. The second fastest is an ad slot that loads 400ms after everything else and shifts the layout. Snapopa's block option exists to handle both.

The defaults

{
  "url": "https://example.com",
  "block": {
    "ads": true,
    "trackers": true,
    "cookies": true,
    "popups": false,
    "media": false
  }
}

Ads, trackers and cookie banners are blocked by default. Popups and media are opt-in, because hiding them can change what the page looks like in ways you might not want.

Network rules vs cosmetic rules

Ads and trackers are blocked at the network layer. We run an adblocking engine built from widely used filter lists, and requests that match are never made. That is where most of the speed-up comes from - fewer requests means the page reaches its load state sooner.

Cookie banners are different. Many consent tools are also what loads the site's own scripts, so blocking them at the network layer can leave a page half-rendered. Instead, cookie and popup blocking is CSS-only: the elements are hidden, but the scripts still run.

Filter lists ship with the image

The filter lists are downloaded and compiled when we build our rendering image, not when a browser starts. A cold browser does not make a single network call to fetch rules, which keeps first-capture latency predictable.

When to turn blocking off

  • Auditing a site's consent flow. Set block.cookies to false so the banner appears exactly as a visitor would see it.
  • Capturing ad placements. Set block.ads to false for ad QA or media-kit screenshots.
  • Debugging a blank area. If a widget is missing, try disabling trackers - occasionally a first-party script shares a hostname with a tracker.

Speeding things up further

If you only need layout and text, block.media drops images, video and fonts. The capture will look different, but for things like content monitoring it can cut render time noticeably.

Try Snapopa

Reading about screenshots? Try the API.

100 free tokens on signup. No credit card. One request is all it takes.

$ curl https://api.snapopa.com/capture \
    -H "Authorization: Bearer sk_•••" \
    -d '{"url":"https://stripe.com"}'

✓ 200 OK
{ "data": { "fileUrl": "https://cdn.snapopa.com/…" } }