Skip to main content

Module assets

Module assets 

Source
Expand description

Cache-dir management for the embedded sidecar assets.

The sidecar JS + package.json are bundled into the Rust binary via include_str! at compile time. At runtime we materialize them into a cache directory under the user’s data dir (e.g. ~/.cache/browser-control/playwright-sidecar-<version>/) and run bun install / npm install there once. Subsequent spawns reuse the cache.

The cache dir name encodes the playwright-core version so different versions don’t share node_modules.

Functions§

ensure_sidecar_dir
Compute the per-version cache directory and ensure it exists with the current sidecar assets written into it.