@@ -225,13 +225,26 @@ fn navigate(
225225 std .log .debug ("res {s}" , .{res });
226226 try server .sendSync (ctx , res );
227227
228- // Runtime.executionContextsCleared event
228+ // Send clear runtime contexts event (noop)
229229 try sendEvent (alloc , ctx , "Runtime.executionContextsCleared" , void , {}, msg .sessionID );
230230
231- // launch navigate
231+ // Launch navigate
232232 var p = try ctx .browser .currentSession ().createPage ();
233233 _ = try p .navigate (params .url );
234234
235+ // Send create runtime context event
236+ ctx .state .executionContextId += 1 ;
237+ try Runtime .executionContextCreated (
238+ alloc ,
239+ ctx ,
240+ ctx .state .executionContextId ,
241+ "http://127.0.0.1:1234" , // TODO: real domain
242+ "" ,
243+ "7102379147004877974.3265385113993241162" ,
244+ .{ .frameId = ctx .state .frameID },
245+ msg .sessionID ,
246+ );
247+
235248 // frameNavigated event
236249 const FrameNavigated = struct {
237250 frame : Frame ,
@@ -267,28 +280,6 @@ fn navigate(
267280 );
268281 }
269282
270- try Runtime .executionContextCreated (
271- alloc ,
272- ctx ,
273- 3 ,
274- "http://127.0.0.1:1234" ,
275- "" ,
276- "7102379147004877974.3265385113993241162" ,
277- .{ .frameId = ctx .state .frameID },
278- msg .sessionID ,
279- );
280-
281- try Runtime .executionContextCreated (
282- alloc ,
283- ctx ,
284- 4 ,
285- "://" ,
286- "__playwright_utility_world__" ,
287- "-4572718120346458707.6016875269626438350" ,
288- .{ .isDefault = false , .type = "isolated" , .frameId = ctx .state .frameID },
289- msg .sessionID ,
290- );
291-
292283 // domContentEventFired event
293284 ts_event = .{ .timestamp = 343721.803338 };
294285 try sendEvent (
0 commit comments