Home / Blog / Tinybrowser: A browser running directly in the browser
Tech News

Tinybrowser: A browser running directly in the browser

tinybrowser ships as a ~19 MB Rust headless browser and WASI Preview 2 WebAssembly build passing 70.4% of WPT subtests with CDP and WebDriver support.

By Dillip Chowdary • Dec 06, 2026 • Source: tinybrowser.ericc.ch

Tinybrowser: A browser running directly in the browser
Image: tinybrowser.ericc.ch

At a glance

Product
tinybrowser
Binary size
~19 MB Rust binary
WPT pass rate
70.4% subtests, 62.5% files
Protocols
CDP, W3C WebDriver Classic and BiDi
JS engine
QuickJS-ng with no JIT
Node requirement
Node 22 or later for WASM SDK

This article details tinybrowser's binary installation, daemon lifecycle, WASI Preview 2 WebAssembly SDK, navigation wait modes, JavaScript API, and experimental limitations. It is aimed at automation engineers, web developers, and AI agent builders evaluating lightweight alternatives to full browser engines for testing, scraping, and headless rendering.

01Single Rust binary and WebAssembly build

Because the engine implements Chrome DevTools Protocol alongside W3C WebDriver Classic and BiDi, existing automation clients can drive it over standard endpoints. Playwright scripts can attach using chromium.connectOverCDP once a daemon is running, while WebDriver Classic clients post to /session and BiDi clients open a WebSocket connection on the same loopback port.

Note: tinybrowser remains experimental: not all Web APIs are implemented yet, JavaScript executes on QuickJS-ng with no JIT so script-heavy pages run slower than V8, out-of-process iframe isolation is absent, OS sandboxing is not battle-tested, and rendering is limited to headless one-shot PNGs.

02Daemon setup and automation protocol support

Developers can run tinybrowser locally via shell installers for macOS, Linux, and Windows PowerShell, or invoke it through Node package managers using npx tinybrowser --help or a global npm install -g tinybrowser. Once installed in ~/.local/bin, %LOCALAPPDATA%\tinybrowser\bin, or $PREFIX/bin on Termux, the CLI manages a persistent background daemon per profile that stays open across tabs and commands while serving both CDP and W3C WebDriver on one loopback port.

  1. Install the binary Run curl -fsSL https://raw.githubusercontent.com/tinybrowser-dev/tinybrowser/main/install.sh | sh on macOS or Linux, irm https://raw.githubusercontent.com/tinybrowser-dev/tinybrowser/main/install.ps1 | iex on Windows PowerShell, or npx tinybrowser --help via npm.
  2. Verify PATH and help Confirm the install directory is on PATH, then run tinybrowser --help, tinybrowser daemon --help, and tinybrowser daemon start --help to inspect commands, flags, and endpoints.
  3. Start the browser daemon Execute tinybrowser daemon start (optionally with --port 4444) to bind the server, verify a ready renderer, and print JSON containing profile, pid, host, port, and url, or use tinybrowser daemon serve for supervisor mode.
  4. Manage daemon state Check a running instance with tinybrowser daemon status and shut it down cleanly with tinybrowser daemon stop.
  5. Connect automation clients Attach Playwright with chromium.connectOverCDP("http://127.0.0.1:<port>") using browser.contexts()[0].pages()[0], send POST http://127.0.0.1:<port>/session for WebDriver Classic, or connect to ws://127.0.0.1:<port>/session for BiDi.

03WASI Preview 2 WebAssembly SDK

For environments where a native binary is impractical, the @tinybrowser/wasm package ships as a WASI Preview 2 component installable via npm install @tinybrowser/wasm or bun add @tinybrowser/wasm. The Node entry point requires Node 22 or later, while Bun, browsers, and Workers each use their own dedicated loaders.

Booting the WebAssembly engine requires passing four pieces to createTinyBrowser: the instantiate helper, a module loader pointing to core.wasm, a transport, and WASI shims. Developers must keep core.wasm in the same directory as its two companion modules because the glue code reads all three files from one folder.

Advertisement

Tech Pulse Daily

Get tomorrow's pulse first

Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.

In Node, scripts import createNodeModuleLoader, createNodeTransport, and createNodeWasi from @tinybrowser/wasm/node alongside instantiate from @tinybrowser/wasm/instantiate. Calling browser.createContext().openTab() opens a tab, tab.goto navigates with options such as waitUntil: "networkidle", and browser.dispose() tears down contexts, tabs, and the engine.

04Wait modes and core browser API

Navigation and idle-waiting methods in the WebAssembly SDK accept four waitUntil modes that control when promises resolve after document loading or network activity. Methods goto, mount, back, forward, and reload default to load, whereas restoreTabState and waitForIdle default to quiet.

ModeResolves when
loadthe document's load event fired
domcontentloadedDOMContentLoaded fired
networkidleno in-flight fetches for 500 ms
quietno in-flight fetches, and load fired or 350 ms passed since content committed

The core API organizes tabs inside isolated cookie and storage contexts created via browser.createContext({ userAgent, storageState }). Calling context.openTab(url?, html?) starts on about:blank or mounts an HTML string directly, while tab.back, tab.forward, and tab.reload traverse history and return navigation-failed when history is empty.

Pages can be inspected and serialized through tab.text(), tab.eval(source), and tab.evalBounded(source, timeoutMs) for wall-clock-limited execution. Calling await tab.render(width, height) returns a one-shot RGBA frame { width, height, rgba } requiring an external PNG encoder, while exportStorageState, importStorageState, exportTabState, and restoreTabState persist cookies, origins, optional IndexedDB, history, and sessionStorage.

05Experimental caveats and source documentation

The project pairs its documentation with explicit source pointers mapping each subsystem to repository files. Exact WIT types, resources, and host imports live in crates/wasm/wit/browser.wit, while WASM driver internals covering waitUntil, pump budgets, and wakeups reside in packages/wasm/src/driver.ts and packages/wasm/src/types.ts.

Platform packaging details for npm optional binaries, target mapping, SHA-256 fallback, and cache paths are documented in packages/cli/README.md and packages/cli/bin/tinybrowser.mjs. Additional references cover browser and Workers loaders in packages/wasm/README.md, a hosted Executor MCP app using Cloudflare Workers and SQLite persistence in apps/executor/index.ts and apps/executor/README.md, and live Web Platform Tests results at /wpt and latest.json.

Early agent testers cited on the project page highlight both its appeal and rough edges. One tester praised having a headless browser without installing half of Debian first, while others noted that missing a fetch <url> command forces WebSocket client workarounds and that bad certificates or dead domains currently surface only a generic navigation failed error.

Frequently asked questions

What is tinybrowser and how big is the binary?

tinybrowser is an experimental headless browser packaged as a single ~19 MB Rust binary. It also compiles to WebAssembly as a WASI Preview 2 component via @tinybrowser/wasm.

Which automation protocols does tinybrowser support?

The tinybrowser daemon serves both Chrome DevTools Protocol (CDP) and W3C WebDriver (Classic and BiDi) on a single loopback port. Playwright can connect using chromium.connectOverCDP, while WebDriver Classic uses POST /session and BiDi uses WebSockets.

What are the current limitations of tinybrowser?

Not all Web APIs are implemented yet, and JavaScript runs on QuickJS-ng with no JIT, making script-heavy pages slower than V8. It also lacks out-of-process iframe isolation, has OS sandboxing that is not battle-tested, and renders only headless one-shot PNGs.

What is required to run @tinybrowser/wasm in Node?

The Node entry point requires Node 22 or later along with createTinyBrowser, instantiate, and the Node loader, transport, and WASI shims. You must keep core.wasm next to its two companion modules in the same directory.

Sources

Dillip Chowdary

Author

Dillip Chowdary

Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.

Related on Tech Bytes

Advertisement

5-min tech signal

Weekday briefing for engineers who skip the noise.

No spam · Unsubscribe anytime

Advertisement

✈️ CareerPilot

Your AI job-search copilot

Match your resume against live Ashby, Greenhouse & Lever openings — fit scores, job-specific resume optimization and email alerts.

Find matching jobs →

Free Tools

Browse all tools →