diff --git a/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp b/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
index 2f58be732d..b2488620c2 100644
--- a/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
+++ b/Libraries/LibWeb/HTML/HTMLIFrameElement.cpp
@@ -79,8 +79,8 @@ void HTMLIFrameElement::load_src(const String& value)
dbg() << "iframe failed to load URL: Invalid URL: " << value;
return;
}
- if (url.protocol() == "file" && content_origin().protocol() != "file") {
- dbg() << "iframe failed to load URL: Security violation: " << document().url() << " may not load " << value;
+ if (url.protocol() == "file" && document().origin().protocol() != "file") {
+ dbg() << "iframe failed to load URL: Security violation: " << document().url() << " may not load " << url;
return;
}