Native Mode (Experimental)

agent-browser includes an experimental native Rust daemon that communicates with Chrome directly via the Chrome DevTools Protocol (CDP), eliminating the Node.js and Playwright dependencies entirely.

Enabling Native Mode

Native mode is opt-in. Enable it with the --native flag or the AGENT_BROWSER_NATIVE environment variable.

CLI Flag

agent-browser --native open example.com
agent-browser --native snapshot
agent-browser --native close

Environment Variable

Set AGENT_BROWSER_NATIVE=1 to avoid passing the flag on every command:

export AGENT_BROWSER_NATIVE=1
agent-browser open example.com
agent-browser snapshot
agent-browser close

Config File

Add "native": true to your agent-browser.json:

{"native": true}

Architecture Comparison

Default (Node.js)Native (--native)
RuntimeNode.js + PlaywrightPure Rust binary
ProtocolPlaywright protocolDirect CDP / WebDriver
Install sizeLarger (Node.js + npm deps)Smaller (single binary)
Browser supportChromium, Firefox, WebKitChromium, Safari (via WebDriver)
StabilityStableExperimental

What Works

All core commands are supported in native mode:

  • Navigation: open, back, forward, reload
  • Interaction: click, fill, type, press, hover, select, check, uncheck, scroll, focus, clear, upload, drag
  • Observation: snapshot, screenshot, eval, get text/html/value/attr/count/box/styles, is visible/enabled/checked
  • State: cookies get/set/clear, storage local/session, state save/load/list
  • Tabs: tab new/list/close, tab switching
  • Emulation: set viewport, set device, set geo, user agent, timezone, locale
  • Streaming: WebSocket screencast and remote input
  • Diffing: diff snapshot, diff url
  • Recording: record start/stop
  • Profiling: profiler start/stop, trace start/stop

Known Limitations

  • Firefox and WebKit are not yet supported (Chromium and Safari only)
  • Playwright trace format is not available (native tracing uses Chrome's built-in tracing)
  • HAR export is not available
  • Network route interception uses CDP Fetch domain instead of Playwright's route API

Switching Between Modes

The native daemon and Node.js daemon share the same session socket. You cannot run both simultaneously for the same session. Close the current daemon before switching:

agent-browser close
export AGENT_BROWSER_NATIVE=1
agent-browser open example.com