mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-05 01:42:54 +00:00
LibWeb: Allow navigating to a new URL by setting window.location.href
This commit is contained in:
parent
1ec4db04cd
commit
efdfdbabdb
Notes:
sideshowbarker
2024-07-19 06:29:03 +09:00
Author: https://github.com/awesomekling
Commit: efdfdbabdb
5 changed files with 32 additions and 3 deletions
|
@ -54,9 +54,13 @@ JS::Value LocationObject::href_getter(JS::Interpreter& interpreter)
|
|||
return JS::js_string(interpreter, window.impl().document().url().to_string());
|
||||
}
|
||||
|
||||
void LocationObject::href_setter(JS::Interpreter&, JS::Value)
|
||||
void LocationObject::href_setter(JS::Interpreter& interpreter, JS::Value value)
|
||||
{
|
||||
// FIXME: Navigate to a new URL
|
||||
auto& window = static_cast<WindowObject&>(interpreter.global_object());
|
||||
auto new_href = value.to_string(interpreter);
|
||||
if (interpreter.exception())
|
||||
return;
|
||||
window.impl().did_set_location_href({}, new_href);
|
||||
}
|
||||
|
||||
JS::Value LocationObject::pathname_getter(JS::Interpreter& interpreter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue