Expand description
P10: Chrome DevTools Protocol (CDP) client.
Attach-only. The user runs Chrome with --remote-debugging-port=N; we
discover N from the pid’s argv and connect. We never spawn a new Chrome
instance — every Chrome life cycle belongs to the user.
§Sync bridge
DesktopBackend stays synchronous. For each browser subcommand we build
a fresh tokio::runtime::Builder::new_current_thread() runtime on the CLI
thread, block_on the async CDP request, and drop the runtime on the way
out. The handler task chromiumoxide returns is spawned on that runtime,
so it is also dropped when the runtime is. Chrome is not affected.
§Errors
Every failure funnels into one of:
ComputerError::Unsupported("...")— built without--features cdp.ComputerError::CdpUnavailable("...")— Chrome not running with a debug port, or the websocket died.ComputerError::BlockedUrl("...")— the URL is in[browser].blocked_urlsin the policy; the request never reaches CDP.ComputerError::InvalidArguments("...")— missing selector/url/script.ComputerError::ElementNotFound("...")— selectorfind_elementcame back empty (synthesized fromfind_elementerrors where applicable).
Structs§
- Action
Options - Argument set the action helpers receive (the
browsersubcommands route to it). - Attach
Options - What the CLI passes to [
attach] so it can find Chrome. - TabSummary
- JSON-friendly tab summary.
Functions§
- activate_
tab - click
- discover_
debug_ port - Highest-level port discovery. Public so unit tests can stub it.
- eval
- list_
tabs - navigate
- parse_
debug_ port - Parse the argv text for
--remote-debugging-port=N(or--remote-debugging-port N). - read_
inner_ text - type_
text - unsupported
- Stable error used when the binary is built without
--features cdp.