mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
improve playwright pafe lifecycle message compatibility
This commit is contained in:
@@ -159,13 +159,13 @@ fn navigate(cmd: anytype) !void {
|
|||||||
);
|
);
|
||||||
|
|
||||||
var page = bc.session.currentPage().?;
|
var page = bc.session.currentPage().?;
|
||||||
try page.navigate(url, aux_data);
|
|
||||||
|
|
||||||
bc.loader_id = bc.cdp.loader_id_gen.next();
|
bc.loader_id = bc.cdp.loader_id_gen.next();
|
||||||
try cmd.sendResult(.{
|
try cmd.sendResult(.{
|
||||||
.frameId = target_id,
|
.frameId = target_id,
|
||||||
.loaderId = bc.loader_id,
|
.loaderId = bc.loader_id,
|
||||||
}, .{});
|
}, .{});
|
||||||
|
|
||||||
|
try page.navigate(url, aux_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pageNavigate(bc: anytype, event: *const Notification.PageEvent) !void {
|
pub fn pageNavigate(bc: anytype, event: *const Notification.PageEvent) !void {
|
||||||
@@ -180,6 +180,14 @@ pub fn pageNavigate(bc: anytype, event: *const Notification.PageEvent) !void {
|
|||||||
|
|
||||||
bc.reset();
|
bc.reset();
|
||||||
|
|
||||||
|
// frameStartedNavigating event
|
||||||
|
try cdp.sendEvent("Page.frameStartedNavigating", .{
|
||||||
|
.frameId = target_id,
|
||||||
|
.url = event.url.raw,
|
||||||
|
.loaderId = loader_id,
|
||||||
|
.navigationType = "differentDocument",
|
||||||
|
}, .{ .session_id = session_id });
|
||||||
|
|
||||||
// frameStartedLoading event
|
// frameStartedLoading event
|
||||||
try cdp.sendEvent("Page.frameStartedLoading", .{
|
try cdp.sendEvent("Page.frameStartedLoading", .{
|
||||||
.frameId = target_id,
|
.frameId = target_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user