From ae15b68b795b6af4e9e39c21c368cf3eefa884ae Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Thu, 31 Aug 2023 18:33:38 +0200 Subject: [PATCH] LibWeb: Call page_did_start_loading from navigate() This fixes a crash in Browser on Serenity --- Userland/Libraries/LibWeb/HTML/Navigable.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/Navigable.cpp b/Userland/Libraries/LibWeb/HTML/Navigable.cpp index 69b1d54724f..21a1f85cbb9 100644 --- a/Userland/Libraries/LibWeb/HTML/Navigable.cpp +++ b/Userland/Libraries/LibWeb/HTML/Navigable.cpp @@ -999,6 +999,11 @@ WebIDL::ExceptionOr Navigable::navigate( // FIXME: 5. If continue is false, then return. } + if (is_top_level_traversable()) { + if (auto* page = active_browsing_context()->page()) + page->client().page_did_start_loading(url, false); + } + // 20. In parallel, run these steps: Platform::EventLoopPlugin::the().deferred_invoke([this, source_snapshot_params = move(source_snapshot_params), document_resource, url, navigation_id, referrer_policy, initiator_origin_snapshot, response, history_handling, initiator_base_url_snapshot] { // NOTE: Not in the spec but subsequent steps will fail because destroyed navigable does not have active document.