mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 17:31:58 -05:00
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:
parent
41ffc69c9d
commit
451df70275
3 changed files with 7 additions and 1 deletions
|
@ -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();
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue