Skip to main content

Module browser

Module browser 

Source
Expand description

High-level native browser session (tabs, navigation, CDP attach).

§Workload

I/O-bound (CDP): multi-target attach uses crate::concurrency::join_bounded_ordered under the process budget. Single-tab navigation/interaction stays sequential (one Page session). Profile cleanup uses spawn_blocking so Drop/async paths do not pin workers.

Structs§

BrowserManager
Owns the CDP client, optional child browser process, and page registry.
PageInfo

Enums§

BrowserProcess
Child process for engines we spawn ourselves (Lightpanda only). Chrome one-shot is owned by chromiumoxide (owns_oxide_browser).
TabRef
A tab reference as parsed from CLI/JSON input. Either a stable id like t2 or a user-assigned label like docs.
WaitUntil

Functions§

format_tab_id
Canonical string form of a stable tab id: t1, t2, … The t prefix disambiguates stable ids from positional indices (which the CLI no longer accepts) and matches the @e<N> convention used for element refs.
is_valid_label
Labels must look like identifiers: start with a letter, contain only letters/digits/dashes/underscores. This keeps them distinguishable from t<N> ids at a glance and safe to pass through shells without quoting.
to_ai_friendly_error
Converts common error messages into AI-friendly, actionable descriptions.
validate_launch_options
Validates launch/connect options for incompatible combinations. Returns Ok(()) if valid, or Err(msg) with a user-friendly error.