Skip to content

Commit 30fd358

Browse files
committed
improve playwright pafe lifecycle message compatibility
1 parent 71c3d48 commit 30fd358

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/cdp/domains/page.zig

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ fn navigate(cmd: anytype) !void {
159159
);
160160

161161
var page = bc.session.currentPage().?;
162-
try page.navigate(url, aux_data);
163-
164162
bc.loader_id = bc.cdp.loader_id_gen.next();
165163
try cmd.sendResult(.{
166164
.frameId = target_id,
167165
.loaderId = bc.loader_id,
168166
}, .{});
167+
168+
try page.navigate(url, aux_data);
169169
}
170170

171171
pub fn pageNavigate(bc: anytype, event: *const Notification.PageEvent) !void {
@@ -180,6 +180,14 @@ pub fn pageNavigate(bc: anytype, event: *const Notification.PageEvent) !void {
180180

181181
bc.reset();
182182

183+
// frameStartedNavigating event
184+
try cdp.sendEvent("Page.frameStartedNavigating", .{
185+
.frameId = target_id,
186+
.url = event.url.raw,
187+
.loaderId = loader_id,
188+
.navigationType = "differentDocument",
189+
}, .{ .session_id = session_id });
190+
183191
// frameStartedLoading event
184192
try cdp.sendEvent("Page.frameStartedLoading", .{
185193
.frameId = target_id,

0 commit comments

Comments
 (0)