Skip to content

Commit

Permalink
Merge pull request #389 from lightpanda-io/cdp-empty-params
Browse files Browse the repository at this point in the history
chromedp: msg missing params or result
krichprollsch authored Jan 28, 2025
2 parents 3fb1677 + 8aac26a commit a74c9e8
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/cdp/cdp.zig
Original file line number Diff line number Diff line change
@@ -206,6 +206,9 @@ pub fn sendEvent(
params: T,
sessionID: ?[]const u8,
) !void {
// some clients like chromedp expects empty parameters structs.
if (T == void) @compileError("sendEvent: use struct{} instead of void for empty parameters");

log_cdp.debug("Event > method {s}, sessionID {?s}", .{ name, sessionID });
const Resp = struct {
method: []const u8,
2 changes: 1 addition & 1 deletion src/cdp/page.zig
Original file line number Diff line number Diff line change
@@ -329,7 +329,7 @@ fn navigate(

// Send Runtime.executionContextsCleared event
// TODO: noop event, we have no env context at this point, is it necesarry?
try sendEvent(alloc, ctx, "Runtime.executionContextsCleared", void, {}, input.sessionId);
try sendEvent(alloc, ctx, "Runtime.executionContextsCleared", struct {}, .{}, input.sessionId);

// Launch navigate, the page must have been created by a
// target.createTarget.

0 comments on commit a74c9e8

Please sign in to comment.