mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 07:03:29 +00:00
cdp: dispatch executionContextCreated on Runtime.enable
This commit is contained in:
@@ -28,6 +28,7 @@ const result = cdp.result;
|
||||
const IncomingMessage = @import("msg.zig").IncomingMessage;
|
||||
const Input = @import("msg.zig").Input;
|
||||
const stringify = cdp.stringify;
|
||||
const target = @import("target.zig");
|
||||
|
||||
const log = std.log.scoped(.cdp);
|
||||
|
||||
@@ -130,6 +131,26 @@ fn sendInspector(
|
||||
|
||||
ctx.sendInspector(msg.json);
|
||||
|
||||
if (method == .enable) {
|
||||
try executionContextCreated(
|
||||
alloc,
|
||||
ctx,
|
||||
0,
|
||||
"://",
|
||||
"",
|
||||
// TODO: hard coded ID
|
||||
"7102379147004877974.3265385113993241162",
|
||||
.{
|
||||
.isDefault = true,
|
||||
.type = "default",
|
||||
// TODO: hard coded ID
|
||||
.frameId = cdp.FrameID,
|
||||
},
|
||||
// TODO: hard coded ID
|
||||
target.BrowserContextID,
|
||||
);
|
||||
}
|
||||
|
||||
if (msg.id == null) return "";
|
||||
|
||||
return result(alloc, msg.id.?, null, null, msg.sessionId);
|
||||
|
||||
@@ -64,9 +64,9 @@ pub fn target(
|
||||
}
|
||||
|
||||
// TODO: hard coded IDs
|
||||
const PageTargetID = "CFCD6EC01573CF29BB638E9DC0F52DDC";
|
||||
const BrowserTargetID = "2d2bdef9-1c95-416f-8c0e-83f3ab73a30c";
|
||||
const BrowserContextID = "65618675CB7D3585A95049E9DFE95EA9";
|
||||
pub const PageTargetID = "CFCD6EC01573CF29BB638E9DC0F52DDC";
|
||||
pub const BrowserTargetID = "2d2bdef9-1c95-416f-8c0e-83f3ab73a30c";
|
||||
pub const BrowserContextID = "65618675CB7D3585A95049E9DFE95EA9";
|
||||
|
||||
// TODO: noop method
|
||||
fn setDiscoverTargets(
|
||||
|
||||
Reference in New Issue
Block a user