prefer resolveNavigation at page, target and fetch

This commit is contained in:
Halil Durak
2026-06-25 17:58:43 +03:00
committed by nikneym
parent 67cc2be817
commit f6fb653a35
3 changed files with 3 additions and 3 deletions

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

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 } },

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 },