# Vireo browser engine

SandboxedJs keeps browser automation APIs in the runtime and distributes the
browser engine independently. The `chrome` command is a Chrome DevTools
Protocol compatibility process used by unmodified Node and Python Playwright;
Vireo is the Rust/WebAssembly document engine behind it.

## Installation

Vireo is a signed `.sbjs` application from the standard application registry:

```sh
pm install vireo
```

Playwright does not need a separate setup step. Installing `playwright-core`
or Python `playwright` creates the executable stubs Playwright expects. The
first launch of one of those stubs installs Vireo if it is absent, verifies its
registry digest, package manifest, and Ed25519 signature, then loads the WASM
module from `/opt/vireo`. Set `SBX_VIREO_AUTOINSTALL=0` to prohibit that lazy
network installation; the compatibility process then retains its minimal
JavaScript-only fallback.

The application registry can still be replaced with `SBX_PM_REGISTRY`, which
is useful for offline mirrors and tests.

## Package contract

Vireo's `app.json` advertises a versioned engine contract:

```json
{
  "provides": ["browser-engine", "playwright-browser"],
  "browserEngine": {
    "abi": "sandboxedjs-browser-engine-v1",
    "wasm": "engine/vireo.wasm",
    "product": "Vireo/0.1.0"
  }
}
```

The v1 WASM ABI transfers a fetched HTML document and its final URL into
Vireo, and receives a serialized, browser-parsed document tree. Networking
stays in SandboxedJs so the same outbound policy, proxy, loopback isolation,
and accounting apply to browser navigation as to `curl` and guest `fetch`.

## Current compatibility

Vireo 0.1 supplies standards-based HTML5 parsing, real HTTP navigation,
redirect handling, document titles, text, attributes, and basic CSS selector
queries in page evaluation. `page.goto()`, `page.title()`, and direct
`page.evaluate()` document access work through unmodified Playwright.

This is the first engine ABI, not a claim of Chromium parity. External and
inline page scripts, subresources, complete DOM mutation, cross-world element
adoption, layout, input actionability, frames, and screenshots remain future
Vireo engine/runtime capabilities. Unsupported CDP methods continue to return
`Method not found`; they are not acknowledged with fabricated results.
