← Back to Target domain

Target.sendMessageToTarget

Sends protocol message over session with given id. Consider using flat mode instead; see commands attachToTarget, setAutoAttach, and crbug.com/991325.

Domain: Target deprecated

Parameters

NameTypeDescription
messagestring
sessionId (optional)SessionIDIdentifier of the session.
targetId (optional)TargetIDDeprecated.

Example Request

{
  "id": 1,
  "method": "Target.sendMessageToTarget",
  "params": {
    "message": "Hello from CDP"
  }
}

Example Response

{
  "id": 1,
  "result": {}
}

Usage in Node.js

const result = await send('Target.sendMessageToTarget', {"message": "Hello from CDP"});
console.log(result);