Sistava

What is Headless Browser?

Also called headless mode, headless browsing.

A headless browser is a full browser engine running without a visible window, controlled entirely by code. It loads pages, executes JavaScript, applies styles, and builds the same document as a normal browser, but renders offscreen. This makes it the standard way to run automated tests and page fetching on servers, where no display exists at all.

Servers usually have no graphical environment, and drawing pixels nobody looks at wastes resources. Mainstream browsers therefore gained official headless modes, which displaced the earlier lightweight engines that never quite matched real browser behavior. Running the same engine that visitors run is the point, because results then reflect what a person would actually see on the page.

Common uses are automated test suites, generating PDFs and screenshots, prerendering pages for crawlers, and fetching content from sites that assemble their markup with JavaScript. That last case explains why a plain HTTP fetch often returns an almost empty document while a headless browser returns the fully populated page.

The cost is significant. Each instance consumes hundreds of megabytes of memory and starts far more slowly than a simple HTTP request, so a fleet of them needs pooling, timeouts, and hard limits or it will exhaust a machine. Where a simple request suffices, reaching for a browser is an expensive habit rather than a robust default.

Headless sessions are detectable through many small signals, and some sites block them or serve different content to them. Since a browser executes whatever code the pages it loads contain, running one against untrusted pages belongs inside a sandbox with a constrained profile, no reuse of sensitive sessions, and restricted outbound network access.

Key points

In practice

A price monitor requests a product page and receives a skeleton with no prices, because the page fills itself in after loading. Switching to a headless browser, the job loads the page, waits until the price element contains text, reads it, and closes the browser. The result is correct, and it costs a couple of seconds and a few hundred megabytes instead of a few milliseconds.

Related terms

Back to the AI Glossary