Skip to content

Headless Browser

What a headless browser is, how it's used for automated screenshots, and common pitfalls.

A headless browser is a web browser that runs without a visible window and is controlled by code. It uses the same engine as the normal browser: it parses HTML, runs JavaScript, computes layout and renders pixels, but draws them into an off-screen buffer.

Chrome and Firefox both have headless modes. Programs control them through protocols such as the Chrome DevTools Protocol, WebDriver and WebDriver BiDi. Libraries such as Puppeteer, Playwright and Selenium wrap these protocols in a programming API.

Because nothing is drawn on screen, a headless browser can run on servers and in CI pipelines that have no display.

How headless browsers work

  1. A script launches the browser in headless mode.
  2. It opens a page, sets the viewport size and loads a URL.
  3. It waits for an event, such as the load event or no network activity.
  4. It runs actions, such as clicks or scrolling, and then requests a screenshot or a PDF.
  5. It closes the page or the browser.

Where headless browsers are used

  • Automated tests that check pages and flows.
  • Scheduled screenshots for monitoring and archiving.
  • Generating PDFs and social preview images from HTML.
  • Collecting public data from pages that need JavaScript to render.

Headless vs headed capture

HeadlessHeaded (visible window)
Display neededNoYes
Speed for batchesUsually fasterSlower
DebuggingHarder, nothing to watchEasier
Detection by sitesMore likelyLess likely

Some sites detect headless browsers and serve different content or block them. Fonts and GPU features can also differ from a desktop browser, so the same page can render slightly differently.

Common mistakes

  • Capturing at the load event on pages that keep loading content.
  • Forgetting to set the viewport, so every capture uses a default size.
  • Running many browsers at once on a small machine.
  • Missing fonts on servers, which changes text layout.

Taking the same screenshots again and again?

Temposhot Website Capture loads URLs in managed local browsers on your Mac without code, with 1 to 10 Concurrent browsers. See website screenshot automation.

Common questions

Do I need to write code to use a headless browser?

Libraries such as Puppeteer and Playwright require code. Desktop tools and screenshot services hide that layer.

Is a headless screenshot identical to a normal one?

Often close, but fonts, GPU rendering and site behavior can differ.

Sources

Taking the same screenshots again and again?

Temposhot captures a screen, window or area on a timer and exports the set as a PDF, images, ZIP or MP4. The free browser tools fix single images.

Related resources

Related terms

All glossary terms