Right now a command I am sending command to targets by wrapping the actual message into a Target.sendMessageToTarget message. I thought with the "flattened" version I would simply need to add sessionId as parameter in the requests, but that doesn't seem to work, e.g.:

{
    "id": 5,
    "method": "Network.enable",
    "params": {"sessionId":"BC34555752DB5344363E505E6D7C5C"}
}

What am I doing wrong? https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-sendMessageToTarget

1

There are 1 best solutions below

0
On

Solved it myself; leaving it here in case someone encounters the same problem:

{
    "id": 5,
    "method": "method.name",
    "sessionId": "BC34555752DB5344363E505E6D7C5C",
    "params": { ... }
}

sessionId must be an entry of the command, not a param.