Engineering
There is no such thing as a loaded page

GitHub's home page fires its load event 0.7 seconds after the request starts. Take a screenshot at that moment and you get a navigation bar above an empty frame.
Wait for the network to go quiet and you do better. At 1.8 seconds the headline is on screen, caught halfway through its entrance animation: "Software still starts", with the words at different heights and the second line missing. The page a visitor sees arrives at 3.0 seconds.

Every screenshot tool has to pick a moment to press the shutter, and browsers offer three signals for it: DOMContentLoaded, load and network idle. We wanted to know how often each one lines up with the picture a person would call finished, so we measured it.
What we measured
We loaded 25 popular home pages three times each in Chrome 156, driven by Playwright 1.65 on an Apple M4 Pro laptop over a home connection. They are the same 25 sites we used in our Kitesurf comparison. Each load got a fresh browser context with an empty cache, a 1280 × 800 viewport, and 20 seconds on the clock.
During those 20 seconds we recorded two things. The first was when each signal fired. The second was every frame the browser painted, taken from Chrome's screencast stream.
Afterwards we compared each frame with the last one of the run. We call the pixels settled from the first moment after which no later frame differs from the last frame by 0.5% of its pixels or more. That threshold is about the area of a 72-pixel square, so a blinking cursor does not count and a late hero image does.
Two sites did not give us their real page. nytimes.com answered with a notice that we had been blocked as a suspected robot, and ebay.com returned an error page on two of its three loads. We left both out, which leaves 23 sites and 69 loads. The numbers describe the first screen only; nothing below the fold was looked at.

DOMContentLoaded is about the document
DOMContentLoaded fires when the HTML has been parsed and deferred scripts have run. MDN is explicit that it does not wait for images, subframes or async scripts. It tells you the document tree exists. It says nothing about what has been drawn.
In our runs the frame on screen at DOMContentLoaded differed from the final frame in 67 of 69 loads. The median load still had 28% of its viewport left to change. Both exceptions were loads of google.com.
Nobody should be surprised by that. It is still the event many scripts wait for, because it is the first one that fires and waiting for it never hangs.
The load event stops counting too early
load fires when the document and the resources it depends on have been fetched: stylesheets, scripts, iframes and images, apart from images marked for lazy loading. It sounds like the answer. The catch is that the browser draws up the list of resources from the markup and whatever scripts have asked for so far. Anything a script requests afterwards is not on it.
A large share of a modern page is requested afterwards. The frame at load differed from the final frame in 50 of 66 loads, with a median of 11% of the viewport still to change. Only Google, Reddit and YouTube gave us their final frame at load in all three runs.

Bing fired load at 1.4 seconds with a search box on a grey gradient, and its background photograph arrived a second later. LinkedIn fired it at 0.5 seconds over a blank white viewport.
The Guardian is the opposite case. Most of its front page was drawn at load, and half a second later a consent dialog covered it. If you wanted the front page, load was the right moment and every later one was wrong.
The other 3 of the 69 loads were CNN, where load did not fire at all inside 20 seconds. The page made a median of 822 requests in that time and was still making them when we stopped. A script that waits for load on that page with a 20-second timeout gets nothing.
Network idle answers a different question
The third signal is not a browser event. Playwright defines networkidle as no network connections for at least 500 milliseconds, and Puppeteer has close relatives. The idea is reasonable: if nothing is being fetched, there is probably nothing left to draw.
It was the best of the three. When it fired, the frame was final in 34 of 50 loads. It has two ways of failing, and we saw plenty of both.
Some pages never go quiet
In 19 of the 69 loads the network never went idle within 20 seconds. Six sites did this on every run: Cloudflare, CNN, Reddit, Walmart, X and Yahoo.
Yahoo is the obvious kind. It made a median of 1,072 requests in 20 seconds, 913 of them after load.
X is the less obvious kind. It made 42 requests in total and its pixels settled at about 2 seconds, but requests kept going out until at least 12 seconds in. Reddit's pixels were settled in about one second while its last request went out after 11.
For a screenshot of those pages, network idle is a timeout with extra steps.
Quiet does not mean still
When the network did go idle, the frame was not final in 16 of 50 loads. Those came from six sites: Amazon, Apple, GitHub, Microsoft, Stack Overflow and TikTok.
GitHub is the cleanest example. By 1.8 seconds its network had been quiet for half a second, and the headline was still animating into place. An animation runs on the clock. It makes no requests, so nothing about the network can tell you it is still going.
The signal also only marks a pause in traffic. GitHub made more requests after going idle, the last of them close to six seconds in.
And when it works, you wait
In the 34 loads where network idle did give the final frame, it fired a median of 2.1 seconds after the pixels had stopped changing. LinkedIn was the extreme. Its sign-in page settled at 0.7 seconds and the network went idle at 10.2.
That is the price of the signal when it is right. On a batch of ten thousand captures, two seconds each is five and a half hours of browsers sitting in front of finished pages.
Some pages have no final frame
In 16 of the 69 loads the viewport was still changing when the 20 seconds ran out. Apple, Cloudflare, CNN and TikTok did it on every run.
TikTok plays video. Apple's and Cloudflare's home pages run animations that repeat, and our frame-by-frame differences for them rise and fall on a cycle of about five seconds for Apple and four for Cloudflare.
A page like that has no moment you can call loaded. Whatever you capture is one frame out of a loop, and a different run will give you a different frame. If your visual regression test flakes on a page with a carousel, this is very likely why.
For the 53 loads that did settle, the median was 1.9 seconds.
What we do with this
The Allscreenshots API takes a waitUntil option with the same three values, and the default is domcontentloaded, the earliest and least informative of them. We picked it because we do not use it to decide when to capture. It only tells the capture service that there is a document to inspect.
From there the service looks at the page itself. It waits for the images in the viewport to decode and for fonts to finish loading. It checks whether anything is still animating in, and waits for a short quiet period in the computed styles of what is on screen. Pages with a slider get a longer window, because their first slide usually fades in piece by piece. All of this runs inside a time budget, so a page that never stops moving is captured anyway.
We did not run our own API in this experiment. The numbers above describe the browser's signals, and we have not shown here that our checks beat them.
There are also things those checks cannot know. A page with a loop, like Apple's, has no finished state to find. And a page that draws its chart five seconds after everything else has gone still looks finished at second four. For that one, tell the API what to wait for:
curl -X POST 'https://api.allscreenshots.com/v1/screenshots' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"url": "https://example.com/dashboard",
"waitFor": ".chart-loaded"
}' \
--output dashboard.webpIf you own the page, you don't need a heuristic
Everything above is guesswork about pages we cannot change. If the page is yours, skip the guessing. Have your application add a class or an attribute to the document when it has drawn what it means to draw, and wait for that selector.
It works the same way in plain Playwright:
await page.goto(url, { waitUntil: 'domcontentloaded' });
await page.waitForSelector('html[data-ready]');
await page.screenshot({ path: 'dashboard.png' });Your application is the only thing that knows when it is done. Playwright's own documentation discourages networkidle for tests and recommends asserting on the page instead, for the same reason.
Limits of this experiment
This was 69 loads on one machine and one connection, on one day.
We only loaded home pages. Many of them are sign-in walls or consent screens, and an article page or a dashboard will behave differently. Sites also served the variant for the place we ran the test from, and consent dialogs differ by region.
The browser was headless Chrome. We removed the word "Headless" from the user agent and changed nothing else. Amazon, Booking.com and Stack Overflow answered with a 202 or 403 status and then showed their normal page.
Recording every frame costs CPU, so the absolute times are probably a little slower than they would be without it. And "never" in this post always means "not within 20 seconds".
The per-load results are available as JSON lines, with a summary and the run settings.
Find out how easy it is to capture and share pixel-perfect screenshots at scale using Allscreenshots. Sign up for a free account and start integrating your first screenshot API call today.


