infrastructure tier

infrastructure-browser-cdp

Chrome DevTools Protocol transport layer for browser automation

Chrome DevTools Protocol transport layer for browser automation

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/browser-cdp
Edition2021
Targetsab_test, chatgpt_debug, chatgpt_dom, check_chatgpt, debug_sw, dump_cookies, find_text, forge_alt_text_suggestion_shot, forge_alt_text_ui_verify, forge_featured_thumb_verify, forge_logout_audit_e2e, forge_logs_verify, forge_media_upload_diag, forge_media_upload_e2e, forge_page_create_e2e, forge_settings_verify, navigate, sw_console, test_extension, test_extension_wasm, test_wasm_sw, wasm_scan_all, infrastructure_browser_cdp, chrome_integration, mock_tests
Public items138 across 12 modules
Tests112

What it is for

This crate does not document itself. No //! block on its entry point. The facts below are complete; the reason this crate exists is not written down anywhere, and belongs in src/lib.rs rather than here.

Capabilities

BoxModel

_No module-level documentation is present in the source._

Item
pub struct BoxModel

DescribeNode

_No module-level documentation is present in the source._

Item
pub struct DescribeNode
DescribeNode :: fn params(& self) -> Value

DescribeNodeResponse

_No module-level documentation is present in the source._

Item
pub struct DescribeNodeResponse

GetBoxModel

_No module-level documentation is present in the source._

Item
pub struct GetBoxModel
GetBoxModel :: fn params(& self) -> Value

GetBoxModelResponse

_No module-level documentation is present in the source._

Item
pub struct GetBoxModelResponse

GetDocument

_No module-level documentation is present in the source._

Item
pub struct GetDocument
GetDocument :: fn params(& self) -> Value

GetDocumentResponse

_No module-level documentation is present in the source._

Item
pub struct GetDocumentResponse

Node

_No module-level documentation is present in the source._

Item
pub struct Node

QuerySelector

_No module-level documentation is present in the source._

Item
pub struct QuerySelector
QuerySelector :: fn params(& self) -> Value

QuerySelectorAll

_No module-level documentation is present in the source._

Item
pub struct QuerySelectorAll
QuerySelectorAll :: fn params(& self) -> Value

QuerySelectorAllResponse

_No module-level documentation is present in the source._

Item
pub struct QuerySelectorAllResponse

QuerySelectorResponse

_No module-level documentation is present in the source._

Item
pub struct QuerySelectorResponse

ResolveNode

_No module-level documentation is present in the source._

Item
pub struct ResolveNode
ResolveNode :: fn params(& self) -> Value

ResolveNodeResponse

_No module-level documentation is present in the source._

Item
pub struct ResolveNodeResponse

SetFileInputFiles

_No module-level documentation is present in the source._

Item
pub struct SetFileInputFiles
SetFileInputFiles :: fn params(& self) -> Value

SetFileInputFilesResponse

_No module-level documentation is present in the source._

Item
pub struct SetFileInputFilesResponse

DispatchKeyEvent

_No module-level documentation is present in the source._

Item
pub struct DispatchKeyEvent
DispatchKeyEvent :: fn params(& self) -> Value

DispatchKeyEventResponse

_No module-level documentation is present in the source._

Item
pub struct DispatchKeyEventResponse

DispatchMouseEvent

_No module-level documentation is present in the source._

Item
pub struct DispatchMouseEvent
DispatchMouseEvent :: fn params(& self) -> Value

DispatchMouseEventResponse

_No module-level documentation is present in the source._

Item
pub struct DispatchMouseEventResponse

InsertText

_No module-level documentation is present in the source._

Item
pub struct InsertText
InsertText :: fn params(& self) -> Value

InsertTextResponse

_No module-level documentation is present in the source._

Item
pub struct InsertTextResponse

KeyEventType

_No module-level documentation is present in the source._

Item
pub enum KeyEventType

MouseButton

_No module-level documentation is present in the source._

Item
pub enum MouseButton

MouseEventType

_No module-level documentation is present in the source._

Item
pub enum MouseEventType

Disable

_No module-level documentation is present in the source._

Item
pub struct Disable
Disable :: fn params(& self) -> Value

DisableResponse

_No module-level documentation is present in the source._

Item
pub struct DisableResponse

Enable

_No module-level documentation is present in the source._

Item
pub struct Enable
Enable :: fn params(& self) -> Value

EnableResponse

_No module-level documentation is present in the source._

Item
pub struct EnableResponse

GetResponseBody

_No module-level documentation is present in the source._

Item
pub struct GetResponseBody
GetResponseBody :: fn params(& self) -> Value

GetResponseBodyResponse

_No module-level documentation is present in the source._

Item
pub struct GetResponseBodyResponse

LoadingFailed

_No module-level documentation is present in the source._

Item
pub struct LoadingFailed

LoadingFinished

_No module-level documentation is present in the source._

Item
pub struct LoadingFinished

RequestData

_No module-level documentation is present in the source._

Item
pub struct RequestData

RequestWillBeSent

_No module-level documentation is present in the source._

Item
pub struct RequestWillBeSent

ResponseData

_No module-level documentation is present in the source._

Item
pub struct ResponseData

ResponseReceived

_No module-level documentation is present in the source._

Item
pub struct ResponseReceived

BringToFront

_No module-level documentation is present in the source._

Item
pub struct BringToFront
BringToFront :: fn params(& self) -> Value

BringToFrontResponse

_No module-level documentation is present in the source._

Item
pub struct BringToFrontResponse

CaptureScreenshot

_No module-level documentation is present in the source._

Item
pub struct CaptureScreenshot
CaptureScreenshot :: fn params(& self) -> Value

CaptureScreenshotResponse

_No module-level documentation is present in the source._

Item
pub struct CaptureScreenshotResponse

Enable

_No module-level documentation is present in the source._

Item
pub struct Enable
Enable :: fn params(& self) -> Value

EnableResponse

_No module-level documentation is present in the source._

Item
pub struct EnableResponse

Navigate

_No module-level documentation is present in the source._

Item
pub struct Navigate
Navigate :: fn params(& self) -> Value

NavigateResponse

_No module-level documentation is present in the source._

Item
pub struct NavigateResponse

ScreenshotFormat

_No module-level documentation is present in the source._

Item
pub enum ScreenshotFormat

CallFunctionOn

_No module-level documentation is present in the source._

Item
pub struct CallFunctionOn
CallFunctionOn :: fn params(& self) -> Value

CallFunctionOnResponse

_No module-level documentation is present in the source._

Item
pub struct CallFunctionOnResponse

Enable

_No module-level documentation is present in the source._

Item
pub struct Enable
Enable :: fn params(& self) -> Value

EnableResponse

_No module-level documentation is present in the source._

Item
pub struct EnableResponse

Evaluate

_No module-level documentation is present in the source._

Item
pub struct Evaluate
Evaluate :: fn params(& self) -> Value

EvaluateResponse

_No module-level documentation is present in the source._

Item
pub struct EvaluateResponse

ExceptionDetails

_No module-level documentation is present in the source._

Item
pub struct ExceptionDetails

RemoteObject

_No module-level documentation is present in the source._

Item
pub struct RemoteObject

CdpCookie

_No module-level documentation is present in the source._

Item
pub struct CdpCookie

ClearCookies

_No module-level documentation is present in the source._

Item
pub struct ClearCookies
ClearCookies :: fn params(& self) -> Value

ClearCookiesResponse

_No module-level documentation is present in the source._

Item
pub struct ClearCookiesResponse

DeleteCookies

_No module-level documentation is present in the source._

Item
pub struct DeleteCookies
DeleteCookies :: fn params(& self) -> Value

DeleteCookiesResponse

_No module-level documentation is present in the source._

Item
pub struct DeleteCookiesResponse

GetCookies

_No module-level documentation is present in the source._

Item
pub struct GetCookies
GetCookies :: fn params(& self) -> Value

GetCookiesResponse

_No module-level documentation is present in the source._

Item
pub struct GetCookiesResponse

AttachToTarget

_No module-level documentation is present in the source._

Item
pub struct AttachToTarget
AttachToTarget :: fn params(& self) -> Value

AttachToTargetResponse

_No module-level documentation is present in the source._

Item
pub struct AttachToTargetResponse

DetachFromTarget

_No module-level documentation is present in the source._

Item
pub struct DetachFromTarget
DetachFromTarget :: fn params(& self) -> Value

DetachFromTargetResponse

_No module-level documentation is present in the source._

Item
pub struct DetachFromTargetResponse

SetAutoAttach

_No module-level documentation is present in the source._

Item
pub struct SetAutoAttach
SetAutoAttach :: fn params(& self) -> Value

SetAutoAttachResponse

_No module-level documentation is present in the source._

Item
pub struct SetAutoAttachResponse

TargetCreated

_No module-level documentation is present in the source._

Item
pub struct TargetCreated

TargetDestroyed

_No module-level documentation is present in the source._

Item
pub struct TargetDestroyed

TargetInfoEvent

_No module-level documentation is present in the source._

Item
pub struct TargetInfoEvent

endpoint (other)

_No module-level documentation is present in the source._

Item
pub const DEFAULT_PORT: u16

BrowserEndpoint

_No module-level documentation is present in the source._

Item
pub struct BrowserEndpoint
BrowserEndpoint :: fn connect(base_url : & str) -> Result <Self, CdpError>
BrowserEndpoint :: fn connect_or_launch(port : u16) -> Result <(Self, Option <Child>), CdpError>
BrowserEndpoint :: fn version(& self) -> Result <BrowserVersion, CdpError>
BrowserEndpoint :: fn list_targets(& self) -> Result <Vec <TargetInfo>, CdpError>
BrowserEndpoint :: fn find_target <F>(& self, predicate : F) -> Result <Option <TargetInfo>, CdpError> where F : Fn(& TargetInfo) -> bool,
BrowserEndpoint :: fn find_targets <F>(& self, predicate : F) -> Result <Vec <TargetInfo>, CdpError> where F : Fn(& TargetInfo) -> bool,
BrowserEndpoint :: fn open_session(& self, target : & TargetInfo) -> Result <CdpSession, CdpError>

CdpError

_No module-level documentation is present in the source._

Item
pub enum CdpError

TargetError

_No module-level documentation is present in the source._

Item
pub enum TargetError

TransportError

_No module-level documentation is present in the source._

Item
pub enum TransportError

CdpSession:CdpSession

_No module-level documentation is present in the source._

Item
pub struct CdpSession

CdpSession:close

_No module-level documentation is present in the source._

Item
CdpSession :: fn close(mut self) -> Result <(), CdpError>

CdpSession:connect

_No module-level documentation is present in the source._

Item
CdpSession :: fn connect(ws_url : & str) -> Result <Self, CdpError>

CdpSession:drop

_No module-level documentation is present in the source._

Item
CdpSession :: fn drop(& mut self)

CdpSession:execute

_No module-level documentation is present in the source._

Item
CdpSession :: fn execute <C : CdpCommand>(& self, cmd : C) -> Result <C::Response, CdpError>
CdpSession :: fn execute_with_timeout <C : CdpCommand>(& self, cmd : C, timeout : Duration,) -> Result <C::Response, CdpError>
CdpSession :: fn execute_raw(& self, method : & str, params : Value) -> Result <Value, CdpError>
CdpSession :: fn execute_raw_with_timeout(& self, method : & str, params : Value, timeout : Duration,) -> Result <Value, CdpError>

CdpSession:fmt

_No module-level documentation is present in the source._

Item
CdpSession :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

CdpSession:next

_No module-level documentation is present in the source._

Item
CdpSession :: fn next_event(& self) -> Result <CdpEvent, CdpError>
CdpSession :: fn next_event_timeout(& self, timeout : Duration) -> Result <CdpEvent, CdpError>

CdpSession:subscribe

_No module-level documentation is present in the source._

Item
CdpSession :: fn subscribe(& self, domains : & EventDomain, buffer_size : usize, overflow_policy : OverflowPolicy,) -> Receiver <CdpEvent>
CdpSession :: fn subscribe_all(& self, buffer_size : usize, overflow_policy : OverflowPolicy,) -> Receiver <CdpEvent>

CdpSession:try

_No module-level documentation is present in the source._

Item
CdpSession :: fn try_next_event(& self) -> Result <Option <CdpEvent>, CdpError>

CdpSession:wait

_No module-level documentation is present in the source._

Item
CdpSession :: fn wait_for_event <F>(& self, predicate : F, timeout : Duration) -> Result <CdpEvent, CdpError> where F : Fn(& CdpEvent) -> bool,

BrowserVersion

_No module-level documentation is present in the source._

Item
pub struct BrowserVersion

CdpCommand

_No module-level documentation is present in the source._

Item
pub trait CdpCommand

CdpEvent

_No module-level documentation is present in the source._

Item
pub struct CdpEvent
CdpEvent :: fn domain(& self) -> EventDomain

EventDomain

_No module-level documentation is present in the source._

Item
pub enum EventDomain
EventDomain :: fn from_method(method : & str) -> Self
EventDomain :: fn is_telemetry(& self) -> bool

OverflowPolicy

_No module-level documentation is present in the source._

Item
pub enum OverflowPolicy

RequestId

_No module-level documentation is present in the source._

Item
pub struct RequestId
RequestId :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

SessionId

_No module-level documentation is present in the source._

Item
pub struct SessionId
SessionId :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

TargetId

_No module-level documentation is present in the source._

Item
pub struct TargetId
TargetId :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result

TargetInfo

_No module-level documentation is present in the source._

Item
pub struct TargetInfo

How to use it

From `examples/ab_test.rs`:

use infrastructure_browser_cdp::commands::runtime;
use infrastructure_browser_cdp::{BrowserEndpoint, DEFAULT_PORT};

fn main() {
    let ep = BrowserEndpoint::connect(&format!("http://localhost:{}", DEFAULT_PORT)).unwrap();

    let page_target = ep
        .find_target(|t| t.url.contains("nytimes.com") && t.target_type == "page")
        .unwrap()
        .expect("No NYTimes tab — navigate there first");
    let _page_tab_id = page_target.id.clone();

    println!("=== A/B TEST: CDP vs WASM Extension ===\n");
    println!("Target: {}\n", page_target.url);

    println!("--- METHOD A: WASM Extension ---");

    let sw_target = ep

From `examples/chatgpt_debug.rs`:

use infrastructure_browser_cdp::commands::runtime;
use infrastructure_browser_cdp::{BrowserEndpoint, DEFAULT_PORT};

fn main() {
    let ep = BrowserEndpoint::connect(&format!("http://localhost:{}", DEFAULT_PORT)).unwrap();
    let t = ep
        .find_target(|t| t.url.contains("chatgpt.com") && t.websocket_url.is_some())
        .unwrap()
        .expect("No ChatGPT tab");

    println!("Tab: {}", t.url);
    let s = ep.open_session(&t).unwrap();

    let js = r#"JSON.stringify({
        editor: !!document.querySelector('#prompt-textarea'),
        editorTag: document.querySelector('#prompt-textarea')?.tagName,
        editorType: document.querySelector('#prompt-textarea')?.type,
        editorContentEditable: document.querySelector('#prompt-textarea')?.contentEditable,

Module structure

infrastructure_browser_cdp

flowchart TD
  n_infrastructure_browser_cdp["infrastructure_browser_cdp"]
  n_infrastructure_browser_cdp --> n_commands["commands"]
  n_commands --> n_commands__dom["dom"]
  n_commands --> n_commands__input["input"]
  n_commands --> n_commands__network["network"]
  n_commands --> n_commands__page["page"]
  n_commands --> n_commands__runtime["runtime"]
  n_commands --> n_commands__storage["storage"]
  n_commands --> n_commands__target["target"]
  n_infrastructure_browser_cdp --> n_endpoint["endpoint"]
  n_infrastructure_browser_cdp --> n_error["error"]
  n_infrastructure_browser_cdp --> n_session["session"]
  n_infrastructure_browser_cdp --> n_types["types"]

Public surface

`commands::dom`

ItemWhat it is
pub struct GetDocumentGet the root DOM node.
GetDocument :: fn params(& self) -> Value
pub struct GetDocumentResponse
pub struct Node
pub struct QuerySelectorQuery a single element by CSS selector.
QuerySelector :: fn params(& self) -> Value
pub struct QuerySelectorResponse
pub struct QuerySelectorAllQuery all elements matching a CSS selector.
QuerySelectorAll :: fn params(& self) -> Value
pub struct QuerySelectorAllResponse
pub struct DescribeNodeDescribe a node in detail.
DescribeNode :: fn params(& self) -> Value
pub struct DescribeNodeResponse
pub struct ResolveNodeResolve a DOM node to a JavaScript object.
ResolveNode :: fn params(& self) -> Value
pub struct ResolveNodeResponse
pub struct GetBoxModelGet the box model (border/padding/content quads) for a node
GetBoxModel :: fn params(& self) -> Value
pub struct GetBoxModelResponse
pub struct SetFileInputFilesSet the files selected on an <input type=file> node — the trusted equivalent of a user picking files in the native dialog
SetFileInputFiles :: fn params(& self) -> Value
pub struct SetFileInputFilesResponse
pub struct BoxModelA node's box model

`commands::input`

ItemWhat it is
pub enum KeyEventTypeKey event type for dispatchKeyEvent.
pub struct DispatchKeyEventDispatch a key event to the page.
DispatchKeyEvent :: fn params(& self) -> Value
pub struct DispatchKeyEventResponse
pub struct InsertTextInsert text as if typed (Input.insertText)
InsertText :: fn params(& self) -> Value
pub struct InsertTextResponse
pub enum MouseEventTypeMouse event type for dispatchMouseEvent.
pub enum MouseButtonMouse button.
pub struct DispatchMouseEventDispatch a mouse event to the page.
DispatchMouseEvent :: fn params(& self) -> Value
pub struct DispatchMouseEventResponse

`commands::network`

ItemWhat it is
pub struct EnableEnable network event collection.
Enable :: fn params(& self) -> Value
pub struct EnableResponse
pub struct DisableDisable network event collection.
Disable :: fn params(& self) -> Value
pub struct DisableResponse
pub struct GetResponseBodyGet response body for a given request ID.
GetResponseBody :: fn params(& self) -> Value
pub struct GetResponseBodyResponse
pub struct RequestWillBeSentFired when a request is about to be sent.
pub struct RequestData
pub struct ResponseReceivedFired when a response is received.
pub struct ResponseData
pub struct LoadingFinishedFired when loading is finished.
pub struct LoadingFailedFired when loading fails.

`commands::page`

ItemWhat it is
pub struct EnableEnable the Page domain events.
Enable :: fn params(& self) -> Value
pub struct EnableResponse
pub struct NavigateNavigate to a URL.
Navigate :: fn params(& self) -> Value
pub struct NavigateResponse
pub struct CaptureScreenshotCapture a screenshot of the page.
pub enum ScreenshotFormat
CaptureScreenshot :: fn params(& self) -> Value
pub struct CaptureScreenshotResponse
pub struct BringToFrontBring the page to front (activate the tab).
BringToFront :: fn params(& self) -> Value
pub struct BringToFrontResponse

`commands::runtime`

ItemWhat it is
pub struct EnableEnable the Runtime domain (required for evaluate).
Enable :: fn params(& self) -> Value
pub struct EnableResponse
pub struct EvaluateEvaluate a JavaScript expression in the global context.
Evaluate :: fn params(& self) -> Value
pub struct EvaluateResponse
pub struct RemoteObject
pub struct ExceptionDetails
pub struct CallFunctionOnCall a function on a specific remote object.
CallFunctionOn :: fn params(& self) -> Value
pub struct CallFunctionOnResponse

`commands::storage`

ItemWhat it is
pub struct GetCookiesGet all cookies from the browser's cookie store
GetCookies :: fn params(& self) -> Value
pub struct GetCookiesResponse
pub struct CdpCookieFull cookie record as returned by CDP.
pub struct DeleteCookiesClear specific cookies.
DeleteCookies :: fn params(& self) -> Value
pub struct DeleteCookiesResponse
pub struct ClearCookiesClear all browser cookies.
ClearCookies :: fn params(& self) -> Value
pub struct ClearCookiesResponse

`commands::target`

ItemWhat it is
pub struct AttachToTargetAttach to a target.
AttachToTarget :: fn params(& self) -> Value
pub struct AttachToTargetResponse
pub struct DetachFromTargetDetach from a target.
DetachFromTarget :: fn params(& self) -> Value
pub struct DetachFromTargetResponse
pub struct SetAutoAttachSet auto-attach for new targets.
SetAutoAttach :: fn params(& self) -> Value
pub struct SetAutoAttachResponse
pub struct TargetCreatedFired when a target is created.
pub struct TargetDestroyedFired when a target is destroyed.
pub struct TargetInfoEventTarget info within events.

`endpoint`

ItemWhat it is
pub const DEFAULT_PORT: u16Default Chrome debugging port.
pub struct BrowserEndpointChrome debugging endpoint for HTTP-based target discovery.
BrowserEndpoint :: fn connect(base_url : & str) -> Result <Self, CdpError>Connect to a Chrome debugging endpoint
BrowserEndpoint :: fn connect_or_launch(port : u16) -> Result <(Self, Option <Child>), CdpError>Connect to Chrome on the default port, or launch it if not running
BrowserEndpoint :: fn version(& self) -> Result <BrowserVersion, CdpError>Get browser version information.
BrowserEndpoint :: fn list_targets(& self) -> Result <Vec <TargetInfo>, CdpError>List all debuggable targets (tabs, workers, etc.)
BrowserEndpoint :: fn find_target <F>(& self, predicate : F) -> Result <Option <TargetInfo>, CdpError> where F : Fn(& TargetInfo) -> bool,Find the first target matching a predicate.
BrowserEndpoint :: fn find_targets <F>(& self, predicate : F) -> Result <Vec <TargetInfo>, CdpError> where F : Fn(& TargetInfo) -> bool,Find all targets matching a predicate.
BrowserEndpoint :: fn open_session(& self, target : & TargetInfo) -> Result <CdpSession, CdpError>Open a CDP session to the given target over WebSocket.

`error`

ItemWhat it is
pub enum CdpError
pub enum TransportError
pub enum TargetError

`session`

ItemWhat it is
pub struct CdpSessionPersistent WebSocket session to a Chrome DevTools Protocol target
CdpSession :: fn connect(ws_url : & str) -> Result <Self, CdpError>Connect to a Chrome target via WebSocket URL.
CdpSession :: fn execute <C : CdpCommand>(& self, cmd : C) -> Result <C::Response, CdpError>Execute a typed CDP command and return the deserialized response.
CdpSession :: fn execute_with_timeout <C : CdpCommand>(& self, cmd : C, timeout : Duration,) -> Result <C::Response, CdpError>Execute a typed CDP command with a custom timeout.
CdpSession :: fn execute_raw(& self, method : & str, params : Value) -> Result <Value, CdpError>Execute a raw CDP command by method name and params.
CdpSession :: fn execute_raw_with_timeout(& self, method : & str, params : Value, timeout : Duration,) -> Result <Value, CdpError>Execute a raw CDP command with a custom timeout.
CdpSession :: fn next_event(& self) -> Result <CdpEvent, CdpError>Get the next control-plane event, blocking until one arrives or timeout.
CdpSession :: fn next_event_timeout(& self, timeout : Duration) -> Result <CdpEvent, CdpError>Get the next control-plane event with timeout.
CdpSession :: fn try_next_event(& self) -> Result <Option <CdpEvent>, CdpError>Get the next control-plane event without blocking.
CdpSession :: fn wait_for_event <F>(& self, predicate : F, timeout : Duration) -> Result <CdpEvent, CdpError> where F : Fn(& CdpEvent) -> bool,Wait for a specific control-plane event matching a predicate, with timeout.
CdpSession :: fn subscribe(& self, domains : & EventDomain, buffer_size : usize, overflow_policy : OverflowPolicy,) -> Receiver <CdpEvent>Subscribe to events from specific domains
CdpSession :: fn subscribe_all(& self, buffer_size : usize, overflow_policy : OverflowPolicy,) -> Receiver <CdpEvent>Subscribe to ALL events (every domain)
CdpSession :: fn close(mut self) -> Result <(), CdpError>Close the session, shutting down the reader thread.
CdpSession :: fn drop(& mut self)
CdpSession :: fn fmt(& self, f : & mut std::fmt::Formatter <'_>) -> std::fmt::Result

`types`

ItemWhat it is
pub struct TargetIdUnique identifier for a browser target (tab, worker, etc.)
TargetId :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub struct SessionIdSession identifier for an attached CDP session
SessionId :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub struct RequestIdAuto-incrementing request ID for correlating CDP responses
RequestId :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub struct BrowserVersionBrowser version information from /json/version
pub struct TargetInfoDescription of a debuggable browser target
pub trait CdpCommandTrait for typed CDP commands
pub struct CdpEventCDP event received from the browser
CdpEvent :: fn domain(& self) -> EventDomainExtract the CDP domain from the method name (e.g., "Network" from "Network.requestWillBeSent").
pub enum EventDomainCDP event domain for routing events to the right queue.
EventDomain :: fn from_method(method : & str) -> SelfParse the domain from a CDP method string like "Network.requestWillBeSent".
EventDomain :: fn is_telemetry(& self) -> boolWhether this domain is high-volume telemetry (routed to subscribers, not control queue).
pub enum OverflowPolicyPolicy for handling subscriber channel overflow.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
CdpErrorerror::CdpError
CdpSessionsession::CdpSession
{BrowserEndpoint,DEFAULT_PORT}endpoint::{BrowserEndpoint,DEFAULT_PORT}
{BrowserVersion,CdpCommand,CdpEvent,EventDomain,OverflowPolicy,RequestId,SessionId,TargetId,TargetInfo,}types::{BrowserVersion,CdpCommand,CdpEvent,EventDomain,OverflowPolicy,RequestId,SessionId,TargetId,TargetInfo,}

Boundary

Depends on no other workspace tier.

Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)infrastructure
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/infrastructure/browser-cdp
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
serde^1derivenoalways
serde_json^1noalways
thiserror^2noalways
tracing^0.1noalways
tungstenite^0.26noalways
ureq^3noalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tungstenite^0.26noalways

Build. None.

Depended on by. 11 workspace crates.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_browser_cdp["application-browser-cdp"] -->|uses| SELF
  n_infrastructure_acquire["infrastructure-acquire"] -->|uses| SELF
  n_infrastructure_browser_automation["infrastructure-browser-automation"] -->|uses| SELF
  n_infrastructure_chatgpt_cdp["infrastructure-chatgpt-cdp"] -->|uses| SELF
  n_infrastructure_gemini_cdp["infrastructure-gemini-cdp"] -->|uses| SELF
  n_infrastructure_whatsapp_cdp["infrastructure-whatsapp-cdp"] -->|uses| SELF
  n_operations_e2e_harness["operations-e2e-harness"] -->|uses| SELF
  n_operations_privacy_scan_runner["operations-privacy-scan-runner"] -->|uses| SELF
  n_platform_disclosure_lab["platform-disclosure-lab"] -->|uses| SELF
  n_tools_browser_test["tools-browser-test"] -->|uses| SELF
  n_tools_sighting_ingest["tools-sighting-ingest"] -->|uses| SELF
  SELF["infrastructure-browser-cdp"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

FeatureEnablesOn by default
wasm-scan-exampleno
flowchart LR
  n_wasm_scan_example["wasm-scan-example"]

Targets

KindNameSource
exampleab_test`examples/ab_test.rs`
examplechatgpt_debug`examples/chatgpt_debug.rs`
examplechatgpt_dom`examples/chatgpt_dom.rs`
examplecheck_chatgpt`examples/check_chatgpt.rs`
exampledebug_sw`examples/debug_sw.rs`
exampledump_cookies`examples/dump_cookies.rs`
examplefind_text`examples/find_text.rs`
exampleforge_alt_text_suggestion_shot`examples/forge_alt_text_suggestion_shot.rs`
exampleforge_alt_text_ui_verify`examples/forge_alt_text_ui_verify.rs`
exampleforge_featured_thumb_verify`examples/forge_featured_thumb_verify.rs`
exampleforge_logout_audit_e2e`examples/forge_logout_audit_e2e.rs`
exampleforge_logs_verify`examples/forge_logs_verify.rs`
exampleforge_media_upload_diag`examples/forge_media_upload_diag.rs`
exampleforge_media_upload_e2e`examples/forge_media_upload_e2e.rs`
exampleforge_page_create_e2e`examples/forge_page_create_e2e.rs`
exampleforge_settings_verify`examples/forge_settings_verify.rs`
examplenavigate`examples/navigate.rs`
examplesw_console`examples/sw_console.rs`
exampletest_extension`examples/test_extension.rs`
exampletest_extension_wasm`examples/test_extension_wasm.rs`
exampletest_wasm_sw`examples/test_wasm_sw.rs`
examplewasm_scan_all`examples/wasm_scan_all.rs`
libinfrastructure_browser_cdp`src/lib.rs`
testchrome_integration`tests/chrome_integration.rs`
testmock_tests`tests/mock_tests.rs`

Error model

Error typeNamed by
CdpErrordeclared, no public signature returns it
TargetErrordeclared, no public signature returns it
TransportErrordeclared, no public signature returns it

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
CHROME_PATHsrc/endpoint.rs

11 workspace crates depend on this one: application-browser-cdp, infrastructure-acquire, infrastructure-browser-automation, infrastructure-chatgpt-cdp, infrastructure-gemini-cdp, infrastructure-whatsapp-cdp, operations-e2e-harness, operations-privacy-scan-runner, platform-disclosure-lab, tools-browser-test, tools-sighting-ingest.

Verification

KindCount
Unit tests81
Integration tests31
Examples22
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
commands::dom1647
commands::input9017
commands::network1211
commands::page928
commands::runtime8210
commands::storage711
commands::target900
endpoint2211
error305
session1110
types903

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc72138
Public modules with a //! block012
pie showData
    title Public items with rustdoc
    "Documented" : 72
    "No rustdoc detected" : 66

Metrics

MetricValue
Rust source files13
Source lines2700
Code lines2196
Public API items138
Public modules12
Tests112
Examples22
Cargo features1
Direct runtime dependencies6
Workspace reverse dependencies11
pie showData
    title Public API by kind
    "constant" : 1
    "enum" : 9
    "method" : 53
    "struct" : 74
    "trait" : 1
pie showData
    title Rust source composition
    "Code" : 2196
    "Blank or comment" : 504

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All infrastructure · Manual