diff --git a/Userland/Libraries/LibWebView/InspectorClient.cpp b/Userland/Libraries/LibWebView/InspectorClient.cpp index 928b691218..b1326aed81 100644 --- a/Userland/Libraries/LibWebView/InspectorClient.cpp +++ b/Userland/Libraries/LibWebView/InspectorClient.cpp @@ -118,6 +118,7 @@ InspectorClient::InspectorClient(ViewImplementation& content_web_view, ViewImple m_inspector_web_view.use_native_user_style_sheet(); m_inspector_web_view.on_inspector_loaded = [this]() { + m_inspector_loaded = true; inspect(); m_content_web_view.js_console_request_messages(0); @@ -191,6 +192,8 @@ InspectorClient::~InspectorClient() void InspectorClient::inspect() { + if (!m_inspector_loaded) + return; if (m_dom_tree_loaded) return; diff --git a/Userland/Libraries/LibWebView/InspectorClient.h b/Userland/Libraries/LibWebView/InspectorClient.h index 15289f62e3..1a87b88b10 100644 --- a/Userland/Libraries/LibWebView/InspectorClient.h +++ b/Userland/Libraries/LibWebView/InspectorClient.h @@ -70,6 +70,7 @@ private: Optional m_body_node_id; Optional m_pending_selection; + bool m_inspector_loaded { false }; bool m_dom_tree_loaded { false }; struct ContextMenuData {