[feat]: expose `ExtensionCDPURL` in `LocalBrowserConnectOptions` in go

Merged
SE
16h ago
+112-1

why

  • this allows users to specify a CDP url that the extension will use for its loopback/in-browser connection

what changed

  • exposed ExtensionCDPURL in LocalBrowserConnectOptions

test plan

  • added unit tests ensuring the URL gets correctly propagated through the protocol

Summary by cubic

Adds an optional ExtensionCDPURL field to LocalBrowserConnectOptions in the Go SDK, letting users set the CDP WebSocket URL the extension uses for its in-browser connection independently of the client's CDP URL. When empty, the client's CDP URL is used as before.

  • Validates ExtensionCDPURL is a ws:// or wss:// URL with a valid host and port before connecting (including rejecting port 0).
  • Propagates the URL to the extension init; falls back to the client's CDP URL when unset.
  • Includes unit tests for validation and propagation.