pl.wendigo.chrome.protocol / DebuggerFramesStream

DebuggerFramesStream

class DebuggerFramesStream : WebSocketListener (source)

DebuggerFramesStream represents connection to remote websocket endpoint of the DevTools Protocol (either inspectable page debugger url http://localhost:9222/json or browser debugger url http://localhost:9222/json/version)

Constructors

<init>

DebuggerFramesStream(webSocketUri: String, framesBufferSize: Int, mapper: FrameMapper, webSocketClient: OkHttpClient)

Creates new WebSocketFramesStream for given web webSocketUri, buffer size, frame mapper, and ws client

Functions

close

fun close(): Unit

Closes stream

eventFrames

fun eventFrames(): Flowable<ResponseFrame>

Returns all frames that represent events from connection.

frames

fun frames(): Flowable<ResponseFrame>

Returns all frames received from connection.

getResponse

fun <T> getResponse(requestFrame: RequestFrame, clazz: Class<T>): Single<T>

Returns protocol response for given request frame (if any).

onClosed

fun onClosed(webSocket: WebSocket, code: Int, reason: String): Unit

onClosed is called when websocket is being closed.

onFailure

fun onFailure(webSocket: WebSocket, t: Throwable, response: Response?): Unit

onFailure is called when websocket protocol error occurs.

onMessage

fun onMessage(webSocket: WebSocket, text: String): Unit

onMessage is called when new frame arrives on websocket.

send

fun send(frame: RequestFrame): Single<Boolean>

Sends frame over the connection.