cdp: add Target.sendMessageToTarget support

see https://chromedevtools.github.io/devtools-protocol/tot/Target/#method-sendMessageToTarget
This commit is contained in:
Pierre Tachoire
2025-01-07 16:00:44 +01:00
parent 5fc763a738
commit 90ba6deba2
3 changed files with 64 additions and 11 deletions

View File

@@ -130,7 +130,8 @@ pub const IncomingMessage = struct {
// asking for getParams, we don't know how to parse them.
fn scanParams(self: *IncomingMessage) !void {
const tt = try self.scanner.peekNextTokenType();
if (tt != .object_begin) return error.InvalidParams;
// accept object begin or null JSON value.
if (tt != .object_begin and tt != .null) return error.InvalidParams;
try self.scanner.skipValue();
self.params_skip = true;
}