mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-07-31 09:46:05 -04:00
prefer resolveNavigation at page, target and fetch
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 } },
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user