Skip to content

Commit 13c2819

Browse files
committed
location: add href setter
* `page.navigateFromWebAPI` seem to be not working while testing; `page.navigate` is preferred instead.
1 parent 20c571b commit 13c2819

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/browser/html/location.zig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ pub const Location = struct {
2929
return "";
3030
}
3131

32+
pub fn set_href(_: *const Location, href: []const u8, page: *Page) !void {
33+
return page.navigate(href, .{ .reason = .script });
34+
}
35+
3236
pub fn get_protocol(self: *Location) []const u8 {
3337
if (self.url) |*u| return u.get_protocol();
3438
return "";

0 commit comments

Comments
 (0)