Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
bao-core
A high-performance anti-fingerprint browser runtime in a single Rust stack — SpiderMonkey + Servo + always-on Node.js/Bun APIs + built-in Stealth and CDP.
Package name vs import name: this package is
bao-core; the library name is pinned tobao.Cargo.tomlsaysbao-core, code saysuse bao::….
[]
= "0.0.1"
Usage — three entry points
1. Embed the browser (primary)
use Duration;
use ;
2. CDP automation (Playwright-style)
Start the CDP server from library config (BaoConfig::cdp_port), then
connect in-process or over WebSocket:
use ;
3. Node/Bun APIs inside the page (dual realm)
page.evaluate_js runs in the Node Realm: DOM and require / fs /
fetch / Bun in one scope.
const h1 = document.?.; // DOM (servo)
const txt = require.; // Node API (Bao)
const res = await ; // Node fetch
Node/Bun host setup without a page: bao::runtime:: (the bun_runtime
surface).
⚠ Same-name trap:
bao::runtime::BaoRuntime(Node/Bun host) ≠ top-levelbao::BaoRuntime(browser coordinator). Browser embedding uses the top-level name; Node/Bun host setup usesbao::runtime::.
Hard constraints & prerequisites
- JSContext is thread-local — DOM ↔ Node interop must stay on the
creating thread; never pass
JSObjectpointers across threads (SIGSEGV). Cross-thread, pass page ids / handles / serialized data. - Full stack always linked — no Cargo features disable browser/CDP/
stealth/Node; behaviour is a runtime choice (
StealthProfile,Permission). - First build compiles SpiderMonkey from source — clang, python3, make required; expect 20–40 min once (cached afterwards).
- Linux media playback needs system GStreamer runtime libraries — the
servo media stack (
bao-servo-media-autoon Linux) loads them at runtime:apt install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad(or your distro's equivalent;-devpackages are a compile-time concern only). BAO_<SUFFIX>environment variables are aliased ontoBUN_<SUFFIX>.
Package family
bao-core is the facade; the family includes bao-browser, bao-engine,
bao-stealth, bao-cdp, bao-cdp-client, bun-runtime and the bun_*
base layer, plus maintained forks bao-mozjs(-sys) (+ bao-mozjs-src-*
source satellites), bao-servo-*, bao-stylo, bao-ipc-channel.
License
MPL-2.0 (SpiderMonkey + Servo) · MIT (Bun-derived crates).