Explorar o código

LibWeb: Only notify PageClient about top-level browsing context loads

We don't need to notify the web views that some deeply nested iframe
has started loading a new URL (and we don't want it showing up in the
browser location bar either!)
Andreas Kling %!s(int64=2) %!d(string=hai) anos
pai
achega
022a49e9ac
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      Userland/Libraries/LibWeb/Loader/FrameLoader.cpp

+ 4 - 2
Userland/Libraries/LibWeb/Loader/FrameLoader.cpp

@@ -172,8 +172,10 @@ bool FrameLoader::load(LoadRequest& request, Type type)
     auto& url = request.url();
 
     if (type == Type::Navigation || type == Type::Reload) {
-        if (auto* page = browsing_context().page())
-            page->client().page_did_start_loading(url);
+        if (auto* page = browsing_context().page()) {
+            if (&page->top_level_browsing_context() == &m_browsing_context)
+                page->client().page_did_start_loading(url);
+        }
     }
 
     // https://fetch.spec.whatwg.org/#concept-fetch