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.
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.cookiestofalseso the banner appears exactly as a visitor would see it. - Capturing ad placements. Set
block.adstofalsefor 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.