Skip to content

Commit cea4f05

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

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
@@ -41,6 +41,10 @@ pub const Location = struct {
4141
return page.navigateFromWebAPI(href, .{ .reason = .script });
4242
}
4343

44+
pub fn set_href(_: *const Location, href: []const u8, page: *Page) !void {
45+
return page.navigate(href, .{ .reason = .script });
46+
}
47+
4448
pub fn get_protocol(self: *Location) []const u8 {
4549
if (self.url) |*u| return u.get_protocol();
4650
return "";

0 commit comments

Comments
 (0)