diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp
index 7b58456019..d7f62d8aab 100644
--- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp
+++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp
@@ -109,13 +109,11 @@ const DOM::Document* BrowsingContextContainer::get_svg_document() const
return nullptr;
}
-HTML::Window* BrowsingContextContainer::content_window() const
+HTML::WindowProxy* BrowsingContextContainer::content_window()
{
- // FIXME: This should return the WindowProxy
- auto* document = content_document();
- if (!document)
+ if (!m_nested_browsing_context)
return nullptr;
- return const_cast(&document->window());
+ return m_nested_browsing_context->window_proxy();
}
// https://html.spec.whatwg.org/multipage/urls-and-fetching.html#matches-about:blank
diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h
index 4ac104d25d..f2f9b14a62 100644
--- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h
+++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h
@@ -24,7 +24,7 @@ public:
const DOM::Document* content_document() const;
DOM::Document const* content_document_without_origin_check() const;
- HTML::Window* content_window() const;
+ HTML::WindowProxy* content_window();
DOM::Document const* get_svg_document() const;
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl
index f0d9ae5aef..0ae7892f98 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl
+++ b/Userland/Libraries/LibWeb/HTML/HTMLIFrameElement.idl
@@ -15,8 +15,7 @@ interface HTMLIFrameElement : HTMLElement {
readonly attribute Document? contentDocument;
- // FIXME: Should return a WindowProxy?
- readonly attribute Window? contentWindow;
+ readonly attribute WindowProxy? contentWindow;
[Reflect] attribute DOMString align;
[Reflect] attribute DOMString scrolling;