chrome-devtools-kotlin / org.hildan.chrome.devtools.protocol / ChromeDPClient / webSocket

webSocket

suspend fun webSocket(): ChromeBrowserSession

Opens a web socket connection to interact with the root (browser) session.

The returned ChromeBrowserSession only provides a limited subset of the possible operations, because it is not attached to any target. To attach to a target using the same underlying web socket connection, call ChromeBrowserSession.attachTo or ChromeBrowserSession.attachToNewPage.

You may prefer directly attaching to any target via a new web socket connection by calling ChromeDPTarget.attach.