prefer resolveNavigation at page, target and fetch

This commit is contained in:
Halil Durak authored and nikneym committed 2026-06-25 18:06:08 +03:00
1 parent 67cc2be817
commit f6fb653a35
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -308,7 +308,7 @@ fn navigate(cmd: *CDP.Command) !void {
const session = bc.session;
const frame = bc.mainFrame() orelse return error.FrameNotLoaded;
const encoded_url = try URL.resolve(frame.call_arena, "", params.url, .{});
const encoded_url = try URL.resolveNavigation(frame.call_arena, params.url, .{});
// Fast path: a freshly-created target whose root frame hasn't navigated
// yet has nothing to preserve across the HTTP round-trip. Skip the
+1 -1
View File
@@ -222,7 +222,7 @@ fn createTarget(cmd: *CDP.Command) !void {
}
if (!std.mem.eql(u8, "about:blank", params.url)) {
const encoded_url = try URL.resolve(frame.call_arena, "", params.url, .{});
const encoded_url = try URL.resolveNavigation(frame.call_arena, params.url, .{});
try frame.navigate(
encoded_url,
.{ .reason = .address_bar, .kind = .{ .push = null } },
+1 -1
View File
@@ -104,7 +104,7 @@ pub fn fetch(app: *App, browser: *Browser, url: [:0]const u8, opts: FetchOpts) !
{
const frame = page.frame().?;
// not guaranteed to be valid after navigate
const encoded_url = try URL.resolve(frame.call_arena, "", url, .{});
const encoded_url = try URL.resolveNavigation(frame.call_arena, url, .{});
_ = try frame.navigate(encoded_url, .{
.reason = .address_bar,
.kind = .{ .push = null },