send

inline fun <T> Connection.send(command: CDP.() -> T): T

Sends a CDP command and waits for the response.

This is an alias so that you can use cdp the same way as zendriver does:

// send a network.enable command with kdriver
tab.send { cdp.network.enable() }

That would be equivalent to this with zendriver:

# send a network.enable command with zendriver
tab.send(cdp.network.enable())

Although you can directly call the CDP methods on the tab (recommended way of doing it):

// send a network.enable command with kdriver, directly
tab.network.enable()

Return

The result of the command, deserialized to type T.

Parameters

command

The command to send. This is a suspending function that can call any CDP method.