mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-02-04 14:33:47 +00:00
Page.scheduleNavigation for location changes
This commit is contained in:
@@ -115,8 +115,6 @@ pub fn CDPT(comptime TypeProvider: type) type {
|
||||
// A bit hacky right now. The main server loop doesn't unblock for
|
||||
// scheduled task. So we run this directly in order to process any
|
||||
// timeouts (or http events) which are ready to be processed.
|
||||
|
||||
pub fn hasPage() bool {}
|
||||
pub fn pageWait(self: *Self, ms: u32) Session.WaitResult {
|
||||
const session = &(self.browser.session orelse return .no_page);
|
||||
return session.wait(ms);
|
||||
|
||||
@@ -221,7 +221,8 @@ fn navigate(cmd: anytype) !void {
|
||||
try page.navigate(params.url, .{
|
||||
.reason = .address_bar,
|
||||
.cdp_id = cmd.input.id,
|
||||
}, .{ .push = null });
|
||||
.kind = .{ .push = null },
|
||||
});
|
||||
}
|
||||
|
||||
pub fn pageNavigate(arena: Allocator, bc: anytype, event: *const Notification.PageNavigate) !void {
|
||||
|
||||
@@ -209,8 +209,7 @@ fn createTarget(cmd: anytype) !void {
|
||||
if (!std.mem.eql(u8, "about:blank", params.url)) {
|
||||
try page.navigate(
|
||||
params.url,
|
||||
.{ .reason = .address_bar },
|
||||
.{ .push = null },
|
||||
.{ .reason = .address_bar, .kind = .{ .push = null } },
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -130,8 +130,8 @@ const TestContext = struct {
|
||||
.{url},
|
||||
0,
|
||||
);
|
||||
try page.navigate(full_url, .{}, .{ .push = null });
|
||||
bc.session.fetchWait(2000);
|
||||
try page.navigate(full_url, .{});
|
||||
_ = bc.session.wait(2000);
|
||||
}
|
||||
return bc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user