CDP multiple target attachment event synchronization
0 reputation · 07 Jun 2023, 22:26 UTC
Chrome DevTools Protocol exposes browser inspection and control via JSON-RPC over WebSocket. Domain-specific methods for DOM, Network and Runtime are dispatched to individual targets, and clients can attach to multiple targets within the same browser instance.
The design goal is to understand event delivery guarantees when several targets are attached simultaneously. The protocol is intended for debugging and automation, with methods that may change across Chrome major versions. Synchronization behavior for concurrent target events is documented as a known complexity.
What ordering guarantees, if any, does CDP provide for events emitted from different targets on a single WebSocket session? Is event delivery per-target serialized while interleaving across targets is allowed? How should a client correlate events to the correct target when handling asynchronous responses from multiple domains?