Ladybird+LibWebView: Ensure existing Inspector widgets inspect the page

If the Inspector widget already exists, be sure to inspect the page when
it is re-opened. However, this should be a no-op if the page was already
inspected (as any existing Inspector will be reset if a new page load
began).

Note this is not an issue in the AppKit chrome.
This commit is contained in:
Timothy Flynn 2023-12-10 10:09:40 -05:00 committed by Andreas Kling
parent 41ffc69c9d
commit 451df70275
Notes: sideshowbarker 2024-07-17 00:25:35 +09:00
3 changed files with 7 additions and 1 deletions

View File

@ -750,6 +750,8 @@ void Tab::show_inspector_window(InspectorTarget inspector_target)
{
if (!m_inspector_widget)
m_inspector_widget = new InspectorWidget(this, view());
else
m_inspector_widget->inspect();
m_inspector_widget->show();
m_inspector_widget->activateWindow();

View File

@ -923,6 +923,8 @@ void Tab::show_inspector_window(Browser::Tab::InspectorTarget inspector_target)
};
m_dom_inspector_widget = window->set_main_widget<InspectorWidget>(*m_web_content_view);
} else {
m_dom_inspector_widget->inspect();
}
if (inspector_target == InspectorTarget::HoveredElement) {

View File

@ -174,7 +174,9 @@ InspectorClient::~InspectorClient()
void InspectorClient::inspect()
{
m_dom_tree_loaded = false;
if (m_dom_tree_loaded)
return;
m_content_web_view.inspect_dom_tree();
m_content_web_view.inspect_accessibility_tree();
}