Target.sendMessageToTargetSends protocol message over session with given id. Consider using flat mode instead; see commands attachToTarget, setAutoAttach, and crbug.com/991325.
| Name | Type | Description |
|---|---|---|
message | string | |
sessionId (optional) | SessionID | Identifier of the session. |
targetId (optional) | TargetID | Deprecated. |
{
"id": 1,
"method": "Target.sendMessageToTarget",
"params": {
"message": "Hello from CDP"
}
}
{
"id": 1,
"result": {}
}
const result = await send('Target.sendMessageToTarget', {"message": "Hello from CDP"});
console.log(result);