mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03: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
Notes:
sideshowbarker
2024-07-17 00:25:35 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/451df70275 Pull-request: https://github.com/SerenityOS/serenity/pull/22241
@ -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 New Issue
Block a user