Expand description
Engine-agnostic tab backend used by the named-tab registry and the scratch-recovery wrapper.
Tab operations on Chromium-family browsers go through CDP
(Target.* + per-target session attach), and on Firefox via WebDriver
BiDi (browsingContext.* + script.evaluate). The named-tab CLI and
the scratch-tab recovery wrapper are engine-independent and just need
these four primitives:
- create a fresh tab at a URL (
about:blankif unspecified). - close a tab by its engine-specific id.
- navigate an existing tab to a URL.
- list every live top-level tab id.
Plus one more for the eval/fetch path:
- evaluate a JS expression in a tab, returning the result value.
target_id is an opaque String on both engines — CDP’s targetId
and BiDi’s context are both opaque ids the registry stores verbatim.
Structs§
- Live
Target - Lightweight view of a live tab returned by
TabBackend::live_targets. Used bytab list --allto merge the named-tab registry with the browser’s current target/context set. - Screenshot
Options - Options for
TabBackend::screenshot. The default is byte-for-byte the previous behaviour: viewport PNG, no clip, no downscale.
Enums§
- Image
Format - Output encoding for
TabBackend::screenshot. - TabBackend
- Engine-agnostic tab operations. Two variants because CDP and BiDi have different protocols and clients; the methods abstract over the difference.
Constants§
- DEFAULT_
JPEG_ QUALITY - JPEG quality used when the caller picks
jpegwithout aquality.
Functions§
- open_
backend - Open the right
TabBackendfor a resolved browser endpoint, taking care of BiDi’ssession.newhandshake. The returned backend isCloneand owns its underlying client viaArc.