cdp: return error in case of missing event's frame

Instead of using the root_frame
This commit is contained in:
Pierre Tachoire
2026-05-13 12:29:11 +02:00
parent 806497c02b
commit 8432cfbfba

View File

@@ -645,7 +645,7 @@ pub fn frameNavigated(arena: Allocator, bc: *CDP.BrowserContext, event: *const N
// frame's JS context for inspector.contextCreated prevents re-registering
// the root context under a new id (which silently invalidates the
// previous id on the V8 side).
const frame = bc.session.findFrameByFrameId(event.frame_id) orelse root_frame;
const frame = bc.session.findFrameByFrameId(event.frame_id) orelse return error.FrameNotFound;
// frameNavigated event
try cdp.sendEvent("Page.frameNavigated", .{