mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
Add sendEvent utility function
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
This commit is contained in:
@@ -81,15 +81,7 @@ fn tagetSetAutoAttach(
|
||||
.browserContextId = BrowserContextID,
|
||||
},
|
||||
};
|
||||
const event = try cdp.method(
|
||||
alloc,
|
||||
"Target.attachedToTarget",
|
||||
AttachToTarget,
|
||||
attached,
|
||||
null,
|
||||
);
|
||||
std.log.debug("event {s}", .{event});
|
||||
try server.sendSync(ctx, event);
|
||||
try cdp.sendEvent(alloc, ctx, "Target.attachedToTarget", AttachToTarget, attached, null);
|
||||
}
|
||||
|
||||
return result(alloc, id, null, null, sessionID);
|
||||
@@ -196,15 +188,7 @@ fn createTarget(
|
||||
},
|
||||
.waitingForDebugger = true,
|
||||
};
|
||||
const event = try cdp.method(
|
||||
alloc,
|
||||
"Target.attachedToTarget",
|
||||
AttachToTarget,
|
||||
attached,
|
||||
sessionID,
|
||||
);
|
||||
std.log.debug("event {s}", .{event});
|
||||
try server.sendSync(ctx, event);
|
||||
try cdp.sendEvent(alloc, ctx, "Target.attachedToTarget", AttachToTarget, attached, sessionID);
|
||||
|
||||
// output
|
||||
const Resp = struct {
|
||||
|
||||
Reference in New Issue
Block a user