LibWeb: Stub out missing cross origin properties on the window object

Previously, trying to access the `close`, `closed` or `blur` properties
on a cross origin window would cause a crash.
This commit is contained in:
Tim Ledbetter 2024-03-30 10:04:31 +00:00 committed by Andreas Kling
commit 3876875bd8
Notes: sideshowbarker 2024-07-17 18:23:22 +09:00
5 changed files with 63 additions and 0 deletions

View file

@ -874,6 +874,21 @@ String Window::status() const
return m_status;
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-close
void Window::close()
{
// FIXME: Implement this properly
dbgln("(STUBBED) Window::close()");
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-closed
bool Window::closed() const
{
// FIXME: Implement this properly
dbgln("(STUBBED) Window::closed");
return false;
}
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-status
void Window::set_status(String const& status)
{
@ -918,6 +933,12 @@ void Window::focus()
// indicate to the user that the page is attempting to gain focus.
}
// https://html.spec.whatwg.org/multipage/interaction.html#dom-window-blur
void Window::blur()
{
// The blur() method steps are to do nothing.
}
// https://html.spec.whatwg.org/multipage/window-object.html#dom-frames
JS::NonnullGCPtr<WindowProxy> Window::frames() const
{