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:
Karl Seguin
2025-04-29 13:29:42 +08:00
parent 2e01fa738a
commit 7309fec51d
5 changed files with 30 additions and 30 deletions

View File

@@ -398,16 +398,6 @@ pub fn BrowserContext(comptime CDP_T: type) type {
const self: *Self = @alignCast(@ptrCast(ctx));
switch (notification.*) {
.context_created => |cc| if (self.target_id) |target_id| {
const aux_data = try std.fmt.allocPrint(self.arena, "{{\"isDefault\":true,\"type\":\"default\",\"frameId\":\"{s}\"}}", .{target_id});
self.inspector.contextCreated(
self.session.page.?.scope,
"",
cc.origin,
aux_data,
true,
);
},
.page_navigate => |*pn| return @import("domains/page.zig").pageNavigate(self, pn),
.page_navigated => |*pn| return @import("domains/page.zig").pageNavigated(self, pn),
}