How CDPClient, CDPLibrary, and CDPRegistrationLibrary work together
mainThe library is structured around three main components that compose the client interface:
CDPClient: The entry point. It holds the WebSocket connection and provides two main interfaces:.sendfor commands and.registerfor events.CDPLibrary: Accessed viaclient.send. It is a collection of domain-specific clients (e.g.,DOMClient,NetworkClient,RuntimeClient). Each domain client provides methods to send CDP commands.CDPRegistrationLibrary: Accessed viaclient.register. It provides domain-specific registration interfaces (e.g.,PageRegistration,RuntimeRegistration) to attach event handlers.
This separation ensures that command execution and event subscription are logically organized by CDP domain.