@@ -117,8 +117,8 @@ fn createIsolatedWorld(cmd: anytype) !void {
117117
118118 // Create the auxdata json for the contextCreated event
119119 // Calling contextCreated will assign a Id to the context and send the contextCreated event
120- const aux_json = try std .fmt .allocPrint (cmd .arena , "{{\" isDefault\" :false,\" type\" :\" isolated\" ,\" frameId\" :\" {s}\" }}" , .{params .frameId });
121- bc .session .inspector .contextCreated (world .executor , world .name , "" , aux_json , false );
120+ const aux_data = try std .fmt .allocPrint (cmd .arena , "{{\" isDefault\" :false,\" type\" :\" isolated\" ,\" frameId\" :\" {s}\" }}" , .{params .frameId });
121+ bc .session .inspector .contextCreated (world .executor , world .name , "" , aux_data , false );
122122
123123 return cmd .sendResult (.{ .executionContextId = world .executor .context .debugContextId () }, .{});
124124}
@@ -213,16 +213,14 @@ pub fn pageNavigate(bc: anytype, event: *const Notification.PageNavigate) !void
213213 }, .{ .session_id = session_id });
214214 }
215215
216- // Send Runtime.executionContextsCleared event
217- // TODO: noop event, we have no env context at this point, is it necesarry?
218216 // When we actually recreated the context we should have the inspector send this event, see: resetContextGroup
219217 // Sending this event will tell the client that the context ids they had are invalid and the context shouls be dropped
220218 // The client will expect us to send new contextCreated events, such that the client has new id's for the active contexts.
221219 try cdp .sendEvent ("Runtime.executionContextsCleared" , null , .{ .session_id = session_id });
222220
223221 if (bc .isolated_world ) | * isolated_world | {
224- // TODO change the allocator
225- const aux_json = try std .fmt .allocPrint ( bc . session . arena . allocator () , "{{\" isDefault\" :false,\" type\" :\" isolated\" ,\" frameId\" :\" {s}\" }}" , .{bc .target_id .? });
222+ var buffer : [ 256 ] u8 = undefined ;
223+ const aux_json = try std .fmt .bufPrint ( & buffer , "{{\" isDefault\" :false,\" type\" :\" isolated\" ,\" frameId\" :\" {s}\" }}" , .{bc .target_id .? });
226224
227225 // Calling contextCreated will assign a new Id to the context and send the contextCreated event
228226 bc .session .inspector .contextCreated (
0 commit comments