fix(browser): scope workers and binary frame sizes

This commit is contained in:
morluto
2026-07-14 05:24:51 +00:00
parent 8481be9c97
commit dfc06cf0ad
4 changed files with 50 additions and 4 deletions
+6 -2
View File
@@ -242,11 +242,15 @@ export class CdpCaptureEvents {
}
const response = recordValue(params.response);
const payload = stringValue(response?.payloadData) ?? "";
const opcode = Math.max(0, Math.trunc(numberValue(response?.opcode) ?? 0));
this.websockets.push({
request_id: requestId,
direction,
opcode: Math.max(0, Math.trunc(numberValue(response?.opcode) ?? 0)),
payload_bytes: Buffer.byteLength(payload),
opcode,
payload_bytes:
opcode === 1
? Buffer.byteLength(payload)
: Buffer.from(payload, "base64").byteLength,
});
}