mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 05:48:12 +00:00
LibWeb: Allow reloading the current page with location.reload()
This commit is contained in:
parent
71007f6ebb
commit
3b11e471bd
5 changed files with 32 additions and 3 deletions
|
@ -119,4 +119,15 @@ void Window::did_set_location_href(Badge<Bindings::LocationObject>, const String
|
|||
view->load(new_href);
|
||||
}
|
||||
|
||||
void Window::did_call_location_reload(Badge<Bindings::LocationObject>)
|
||||
{
|
||||
auto* frame = document().frame();
|
||||
if (!frame)
|
||||
return;
|
||||
auto* view = frame->html_view();
|
||||
if (!view)
|
||||
return;
|
||||
view->reload();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
void set_timeout(JS::Function&, i32);
|
||||
|
||||
void did_set_location_href(Badge<Bindings::LocationObject>, const String& new_href);
|
||||
void did_call_location_reload(Badge<Bindings::LocationObject>);
|
||||
|
||||
private:
|
||||
explicit Window(Document&);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue