emit context created on createTarget event for chromedp

This commit is contained in:
Karl Seguin
2025-04-29 10:58:23 +08:00
parent 2d5ff8252c
commit 9044925f32
3 changed files with 7 additions and 4 deletions

View File

@@ -404,8 +404,8 @@ pub fn BrowserContext(comptime CDP_T: type) type {
const self: *Self = @alignCast(@ptrCast(ctx));
switch (notification.*) {
.context_created => |cc| {
const aux_data = try std.fmt.allocPrint(self.arena, "{{\"isDefault\":true,\"type\":\"default\",\"frameId\":\"{s}\"}}", .{self.target_id.?});
.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,
"",