From 2323c777187ea46deb1d9ff40ac9e04edcad19c0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Mon, 28 Aug 2023 16:52:07 +0200 Subject: [PATCH] LibWeb: Call page_did_create_main_document() from navigables navigation Before, this function were called from FrameLoader and now we still have to call it from navigables navigation code so JS Console is created. --- Userland/Libraries/LibWeb/HTML/Navigable.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index aa43989120..03380af2a9 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -182,11 +182,9 @@ void Navigable::activate_history_entry(JS::GCPtr entry) new_document->make_active(); // Not in the spec: - if (is(*this) && parent() == nullptr) { - if (auto* page = active_browsing_context()->page()) { - page->client().page_did_start_loading(entry->url, false); - } - } + VERIFY(active_browsing_context()); + VERIFY(active_browsing_context()->page()); + active_browsing_context()->page()->client().page_did_create_new_document(*new_document); } // https://html.spec.whatwg.org/multipage/document-sequences.html#nav-document