Ladybird browser: its engine, headless mode, and screenshots

What the Ladybird browser is, how its independent engine is built, and how to take screenshots with its headless mode and WebDriver, compared with Chrome/Chromium.

Blog post12 min read

Written by

Dmytro Krasun

Updated on

Ladybird is a web browser with its own engine, built by a non-profit and not based on Chromium, WebKit or Gecko. Below, I explain what that means, how the browser is built, and how to take screenshots with it: from the command line, through WebDriver, and side by side with Chrome/Chromium.

ScreenshotOne renders every screenshot with Chrome/Chromium, so a browser engine that is written independently from Chromium is worth testing. Does it draw real pages the same way?

At the moment of writing (November 29), Ladybird is considered an alpha, with builds for Apple Silicon Macs and Linux:

Ladybird
@ladybirdbrowser

Ladybird is now in alpha 🐞

Downloads for macOS and Linux available on our website.

ladybird.org/posts/alpha/

409 replies1,600 reposts9,800 likes3,700 bookmarks1,000,000 views

The project makes no security promises at this stage, so I used a temporary profile and public pages only.

What is the Ladybird browser?

Ladybird is an open-source web browser whose engine is written from scratch against the web standards. Its HTML and CSS engine (LibWeb), JavaScript engine (LibJS) and WebAssembly engine (LibWasm) are the project’s own code, and the code is under a 2-clause BSD license.

It is built by the Ladybird Browser Initiative, a US 501(c)(3) non-profit. According to its website, the browser is “funded entirely by donations and sponsorships”, and the project will not take money from “default search deals” or other forms of user monetization.

The code is older than the browser. Andreas Kling started it in 2019 as the HTML viewer for SerenityOS, a hobby operating system. It was named Ladybird in 2022 and became a separate cross-platform project the same year; the non-profit was launched in 2024. The project FAQ has the full timeline.

Builds are on the download page.

Browser engine versus browser

A browser is what you see: the window, tabs, address bar and settings. The engine is what turns HTML, CSS and JavaScript into pixels. Many browsers share one engine:

EngineBrowsers that use it
BlinkChrome, Edge, Opera, Brave
WebKitSafari
GeckoFirefox
LibWebLadybird

Most people browse with one engine: in October 2026, StatCounter measured Chrome alone at about 67% of desktop browsing, and Edge, also built on Blink, at 13%.

For screenshots, the engine is what matters. Two browsers on the same engine produce nearly the same image; two engines can differ in fonts, layout and supported CSS.

How Ladybird is built

“From scratch” applies to the engine, not to every line of code. Ladybird writes the parts that interpret the web and uses well-known libraries for the rest:

Ladybird’s own codeThird-party libraries
HTML, CSS and the DOM (LibWeb)2D graphics (Skia)
JavaScript (LibJS)Text shaping (HarfBuzz)
WebAssembly (LibWasm)Audio and video (FFmpeg)
The browser interface and process modelHTTP transfers (curl)

One browser, many processes

Ladybird splits itself into processes, so that a page that crashes or is taken over reaches as little as possible. Web content runs in sandboxed processes, and work on untrusted data, such as decoding images, is split off into more sandboxed helpers:

Click a process to see what it does

Helpers for each renderer

Based on Ladybird's process architecture document. sandboxed

Three ideas carry the design:

  • Hub starts everything. It launches every other process, because their sandboxes do not let them start anything themselves, and then connects them directly. A renderer talks to its network and image processes without going through Hub.
  • Each site gets its own processes. Documents of different sites, cross-site frames included, go to different renderers, each with its own network process and image decoder. Turn on “Open two sites” in the diagram to see what doubles.
  • The renderer does not touch the GPU, the network or local files. WebContent runs LibWeb and LibJS; the Compositor draws its pages, RequestServer fetches for it and Hub opens files for it.

Every process except UI and Hub sandboxes itself as it starts: with seccomp and Landlock on Linux, and with the Seatbelt sandbox on macOS. With --headless, UI has nothing to do and Hub takes over its process; the renderer and its helpers stay the same. The process architecture document has the details.

The executables are being renamed. In the current source code, they all start with ladybird (ladybird-render for renderers, ladybird-net for networking), so pgrep -l ladybird lists them all. Builds from before the rename use names such as WebContent and RequestServer.

Browsing with Ladybird

Before scripting it, I used Ladybird as a normal browser on my personal website and its laboratory of side projects: an isometric 3D city map, a browser game with a dinosaur, and a gravity simulation. I tested it on a few projects I recently made and couldn’t break anything:

Take a screenshot with headless mode

Ladybird has a --headless flag. Its default mode, screenshot, loads a page, waits, and saves a PNG. On macOS, the Ladybird executable is inside the app bundle, in Contents/MacOS:

Take a full-page screenshot
Ladybird \
--headless=screenshot \
--temporary-profile \
--window-width 1280 --window-height 800 \
--screenshot-delay 5 \
--screenshot-path ./ladybird-homepage.png \
https://screenshotone.com/
  • --temporary-profile uses a fresh profile that is removed when the browser exits.
  • --window-width and --window-height set the viewport. Without them, the viewport is 800 × 600.
  • --screenshot-delay is the number of seconds to wait after loading. The default is 1.
  • --screenshot-path sets the file. Without it, the image goes to your Downloads folder as screenshot-<date>-<time>.png.

The command printed Taking screenshot after 5 seconds and Saved screenshot to: ladybird-homepage.png, and finished in 6.4 seconds. The image was 1,280 × 10,753: the screenshot mode captures the full page, not only the viewport. This is its top 800 pixels:

The ScreenshotOne homepage rendered by Ladybird in headless mode, top 1,280 × 800 pixels

Click the preview to open the full capture:

Full-page Ladybird screenshot of the ScreenshotOne homepage, from the header to the footer

Ladybird has other headless modes:

  • --headless=text prints the page’s text to the terminal.
  • --headless=layout-tree prints the layout tree: every box with its position and size. It is useful for checking how the engine laid out a page without looking at pixels.
  • --headless=terminal draws the page in the terminal. It refused to start without an interactive terminal (Terminal mode needs to run in a terminal), so I have no sample.

Run Ladybird --help on your build before scripting these flags; the help text is the authority for the version you have.

Take a screenshot through WebDriver

A fixed delay is a guess. A page that is slow today gets captured half-loaded, and a fast page wastes seconds. Ladybird’s WebDriver documentation says it too: “Avoid fixed sleeps to decide when a page is ready.”

Ladybird ships a W3C WebDriver server next to the browser executable. In current macOS builds it is called WebDriver; newer source code names it ladybird-driver, so check which one your build has. Start it:

Start Ladybird's WebDriver server
WebDriver --headless --listen-address 127.0.0.1 --port 4444

The script below needs no packages: it uses fetch and Node.js built-ins, and Node.js 22.18 or later runs the .ts file directly. It opens a session with the ladybird:headless capability, sets a 1,280 × 800 viewport, waits for the page’s h1 instead of sleeping, and saves the viewport and the heading as PNG files:

screenshot.ts
import { writeFile } from "node:fs/promises";
import { setTimeout as sleep } from "node:timers/promises";
const DRIVER_URL = "http://127.0.0.1:4444";
type Method = "GET" | "POST" | "DELETE";
type ElementRef = Record<string, string>;
// Sends one WebDriver command and returns its "value".
async function webdriver<T = unknown>(
method: Method,
path: string,
body?: object,
): Promise<T> {
const response = await fetch(DRIVER_URL + path, {
method,
headers: { "Content-Type": "application/json" },
body: body && JSON.stringify(body),
});
const { value } = await response.json();
if (!response.ok) {
throw new Error(`${value.error}: ${value.message}`);
}
return value as T;
}
async function savePng(path: string, base64: string) {
await writeFile(path, Buffer.from(base64, "base64"));
}
const { sessionId } = await webdriver<{ sessionId: string }>(
"POST",
"/session",
{ capabilities: { alwaysMatch: { "ladybird:headless": true } } },
);
const session = `/session/${sessionId}`;
try {
await webdriver("POST", `${session}/window/rect`, {
width: 1280,
height: 800,
});
await webdriver("POST", `${session}/url`, {
url: "https://screenshotone.com/",
});
// Wait for the heading instead of a fixed delay.
let headings: ElementRef[] = [];
for (let attempt = 0; attempt < 50; attempt++) {
headings = await webdriver<ElementRef[]>(
"POST",
`${session}/elements`,
{ using: "css selector", value: "h1" },
);
if (headings.length > 0) break;
await sleep(200);
}
const page = await webdriver<string>("GET", `${session}/screenshot`);
await savePng("page.png", page);
const [id] = Object.values(headings[0]);
const heading = await webdriver<string>(
"GET",
`${session}/element/${id}/screenshot`,
);
await savePng("heading.png", heading);
} finally {
await webdriver("DELETE", session);
}

page.png was a 1,280 × 800 capture of the viewport. Unlike the headless flag, the WebDriver screenshot command captures only the visible part of the page.

The element screenshot was not right on this build. The heading’s box is 588 × 120 pixels, and Chrome’s driver returned exactly that. Ladybird returned 1,248 × 569: everything from the heading’s top-left corner to the edge of the viewport. I got the same result on a second page:

Ladybird's element screenshot of the homepage heading, which also includes the text, buttons and testimonials below and beside it

Until that is fixed, take the viewport screenshot and crop it to the rectangle from GET /session/{id}/element/{element}/rect.

Selenium, Puppeteer and Playwright

  • Selenium worked with selenium-webdriver for Node.js (npm install selenium-webdriver). Point the builder at Ladybird’s server and pass the Ladybird capability; waits and screenshots then work as with any other browser:

    selenium.ts
    import { writeFile } from "node:fs/promises";
    import { Builder, By, until } from "selenium-webdriver";
    const driver = await new Builder()
    .usingServer("http://127.0.0.1:4444")
    .withCapabilities({
    browserName: "ladybird",
    "ladybird:headless": true,
    })
    .build();
    try {
    await driver.manage().window().setRect({ width: 1280, height: 800 });
    await driver.get("https://screenshotone.com/");
    await driver.wait(until.elementLocated(By.css("h1")), 10_000);
    const image = await driver.takeScreenshot();
    await writeFile("selenium.png", image, "base64");
    } finally {
    await driver.quit();
    }

    Our Selenium screenshot guide covers more options.

  • Puppeteer did not connect. Ladybird supports WebDriver BiDi, and Puppeteer can use BiDi instead of the Chrome DevTools Protocol. A session created with webSocketUrl: true returned a WebSocket address, but Puppeteer failed with A session already exists on that address. Ladybird’s options list a Firefox DevTools server, not the Chrome DevTools Protocol, which Puppeteer normally uses. If you need Puppeteer, see our Puppeteer screenshot guide with Chrome.

  • Playwright drives its own builds of Chromium, Firefox and WebKit and does not speak WebDriver, so it cannot drive Ladybird.

The same pages in Ladybird and Chrome

I captured eight pages in both browsers with the same method:

  • the same WebDriver script, pointed at Ladybird’s server and at chromedriver with Chrome in headless mode;
  • a 1,280 × 800 viewport at a pixel ratio of 1;
  • a 3-second wait after the page loaded, then a viewport screenshot.

Seven pages are public; the eighth is a local test page with a sticky header, backdrop-filter, a CSS grid with auto-fit, :has(), a container query, an inline SVG and the Inter font from Google Fonts.

To count differences, I compared the two images pixel by pixel and counted pixels whose brightness differed by more than 24 of 255. The page height comes from document.documentElement.scrollHeight in each browser.

PagePage height (Ladybird / Chrome)Pixels that differWhat I saw
ScreenshotOne homepage10,752 / 10,7521.4%Same layout. Our chat button had loaded in Ladybird and not yet in Chrome.
ScreenshotOne options docs80,766 / 80,7621.6%Same layout, same chat button difference.
A ScreenshotOne blog post11,564 / 11,5631.5%Same layout, same chat button difference.
Wikipedia article3,333 / 3,3334.6%Same layout. Some lines of text sit one pixel apart.
GitHub repository3,871 / 3,8722.6%Same layout. Only “1 minute ago” became “2 minutes ago”.
Hacker News1,217 / 1,2172.2%Same layout. The ranking changed between the two runs.
MDN reference page10,794 / 10,7653.5%Same layout. The sidebar was scrolled to a different position.
Local test page800 / 8001.4%Same layout, including every CSS feature on the page.

None of the eight pages broke. Most differing pixels come from text: the two browsers draw the same font at slightly different positions and with different anti-aliasing. That is enough to fail an exact pixel comparison and too little to notice by eye.

The local test page shows it best. Every feature rendered, and the two captures are hard to tell apart:

The local test page in Ladybird on the left and Chrome on the right: the same gradient banner, tags, cards, shadows and SVG chart

Wikipedia had the most differing pixels. Side by side, the layout is the same, and the difference is in the lines of text:

A Wikipedia article in Ladybird on the left and Chrome on the right, with the same layout

On MDN, the left sidebar list starts at a slightly different scroll position, and the page is 29 pixels taller in Ladybird:

An MDN reference page in Ladybird on the left and Chrome on the right; the sidebar list is scrolled differently

These are eight pages on one build. Pages that use newer APIs or complex web apps may differ more, and every Ladybird build changes the result.

Screenshot features in Ladybird and Chrome

FeatureLadybirdChrome
Set the viewportYes, headless flags or WebDriver (tested)Yes
Full-page captureYes, the headless flag always captures the full page (tested)Yes, through the DevTools Protocol
Higher pixel ratioNo: --device-pixel-ratio 2 still gave 1,280 × 800 in screenshot mode; the help text says it applies to terminal mode only (tested)Yes
Wait for an elementThrough WebDriver only; the headless flag has a fixed delay (tested)Yes
Element screenshotReturned the wrong area (tested)Yes
Ad and banner blockingA built-in content blocker that takes your own block lists, --content-blocker-list (from the help text)Through extensions
Automation protocolsWebDriver and WebDriver BiDi; Firefox DevTools server (from the help text and documentation)WebDriver, WebDriver BiDi and the Chrome DevTools Protocol
PlatformsApple Silicon Macs and LinuxmacOS, Windows and Linux

One more detail matters for screenshots of other people’s sites. Ladybird’s user agent names Ladybird, then adds the tokens Chrome and Safari send. It looks like this:

Ladybird's user agent
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) Ladybird/2026.48.1 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/153.0.0.0 Safari/537.36

The source code calls this constant SAD_COMPATIBILITY_HACK: some sites serve a broken or reduced page to browsers they do not recognize, so Ladybird presents itself as a common browser to receive the normal page.

When to use Ladybird for screenshots

Use Ladybird to check your own pages in an independent engine. Capture the pages you care about, compare them with Chrome, and report what breaks to the Ladybird project. That is how a new engine gets better, and it shows you where your site depends on behavior that only Chromium has.

For production screenshots, the build I tested is not there yet: no higher pixel ratio, a wrong element capture, fixed delays in the command-line mode, no Windows build, and no security promises. Re-test when a new release comes out, because each build changes these answers.

If you need screenshots of any URL at scale without running browsers, ScreenshotOne renders with the latest stable Chrome/Chromium. Its options cover the features from the table: viewport_width and viewport_height, full_page, device_scale_factor for higher-resolution images, wait_for_selector for waiting, and selector for element screenshots. It can also block ads, cookie banners, chat widgets and trackers before the capture with block_ads, block_cookie_banners, block_chats and block_trackers, so the image shows the page itself.

Ladybird is not ready for ScreenshotOne yet. Our renderer is built on Puppeteer and also talks to the browser through the Chrome DevTools Protocol directly. Ladybird does not implement that protocol: it offers WebDriver, WebDriver BiDi and a Firefox DevTools server. Until that changes, ScreenshotOne cannot render with Ladybird.

Frequently Asked Questions

If you read the article, but still have questions. Please, check the most frequently asked. And if you still have questions, feel free reach out at support@screenshotone.com.

Is Ladybird based on Chromium?

No. Ladybird uses its own engine: LibWeb for HTML and CSS, LibJS for JavaScript and LibWasm for WebAssembly. It is not a fork of Chromium, WebKit or Gecko, although it uses third-party libraries for graphics, fonts, media and networking.

Who makes the Ladybird browser?

The Ladybird Browser Initiative, a US 501(c)(3) non-profit. Andreas Kling started the project in 2019 as the HTML viewer of the SerenityOS operating system. It is funded by donations and sponsorships, and the project says it will not take money from default search deals.

Does Ladybird have a headless mode?

Yes. Run it with --headless=screenshot to save a PNG of the page, or use the text and layout-tree modes to print the page's text or layout. For scripts, Ladybird ships a WebDriver server that accepts the ladybird:headless capability.

Read more Screenshot rendering

Interviews, tips, guides, industry best practices, and news.

View all posts
How to take website screenshots with Go

How to take website screenshots with Go

The article examines how you can take screenshots of any URL with Go (a.k.a. Golang) by using Selenium, Puppeteer alternatives, Playwright, or screenshot API as a service.

Read more
How to Build a Screenshot API

How to Build a Screenshot API

Learn how to build a screenshot API from scratch. Render website screenshots, capture full pages, block cookie banners, trigger lazy-loaded content, upload results, and prepare the service for deployment.

Read more
Automate website screenshots in Airtable

Automate website screenshots in Airtable

Capture a website from an Airtable record and save the image as an attachment. Use an automation secret, report errors, and handle temporary screenshot URLs.

Read more

Automate website screenshots

Exhaustive documentation, ready SDKs, no-code tools, and other automation to help you render website screenshots and outsource all the boring work related to that to us.