mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-28 14:43:28 +00:00
location: add href setter
* `page.navigateFromWebAPI` seem to be not working while testing; `page.navigate` is preferred instead.
This commit is contained in:
@@ -41,6 +41,10 @@ pub const Location = struct {
|
||||
return page.navigateFromWebAPI(href, .{ .reason = .script });
|
||||
}
|
||||
|
||||
pub fn set_href(_: *const Location, href: []const u8, page: *Page) !void {
|
||||
return page.navigate(href, .{ .reason = .script });
|
||||
}
|
||||
|
||||
pub fn get_protocol(self: *Location) []const u8 {
|
||||
if (self.url) |*u| return u.get_protocol();
|
||||
return "";
|
||||
|
||||
Reference in New Issue
Block a user