mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-12-16 08:18:59 +00:00
Fully fake contextCreated
emit contextCreated when it's needed, not when it actually happens. I thought we could make this sync-up, but we'd need to create 3 contexts to satisfy both puppeteer and chromedp. So rather than having it partially driven by notifications from Browser, I rather just fake it all for now.
This commit is contained in:
@@ -125,7 +125,18 @@ fn createTarget(cmd: anytype) !void {
|
||||
try bc.createIsolatedWorld();
|
||||
bc.target_id = target_id;
|
||||
|
||||
_ = try bc.session.createPage();
|
||||
const page = try bc.session.createPage();
|
||||
|
||||
{
|
||||
const aux_data = try std.fmt.allocPrint(cmd.arena, "{{\"isDefault\":true,\"type\":\"default\",\"frameId\":\"{s}\"}}", .{target_id});
|
||||
bc.inspector.contextCreated(
|
||||
page.scope,
|
||||
"",
|
||||
try page.origin(cmd.arena),
|
||||
aux_data,
|
||||
true,
|
||||
);
|
||||
}
|
||||
|
||||
// change CDP state
|
||||
bc.security_origin = "://";
|
||||
|
||||
Reference in New Issue
Block a user