diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2023-12-04 16:05:55 +0100 |
---|---|---|
committer | Szabolcs David <davidsz@inf.u-szeged.hu> | 2024-02-09 11:06:18 +0000 |
commit | 6acf981aae2165cde6829f309f3792fc34852fd2 (patch) | |
tree | de19482f481aab885754d094f07d98527695d150 /src/core/web_contents_adapter.cpp | |
parent | 2af8c8c0b35bd37ba8df591d928720d2b894e816 (diff) |
Show guest WebContents in DevTools if possible
Chrome's DevTools has different behavior for PDF content:
- If it was opened for the PDF viewer, it closes itself when the
guest view has gone (e.g. by navigating away), but it shows the
inner content of the plugin.
- If it was opened for another site and then navigated to the PDF
plugin it won't show the inner content, but the embedding HTML of
the parent and it allows navigating away from the plugin.
Make our inspector match the behavior of Chrome and allow DevTools
to look into the plugin. It helps debugging PDF viewer related
issues.
Pick-to: 6.6 6.7
Change-Id: I218d4fcf47d6b1f0101fa1d7f36758e04a1dd7b0
Reviewed-by: Anu Aliyas <anu.aliyas@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index a5ea37225..f549bfac0 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1250,7 +1250,10 @@ void WebContentsAdapter::openDevToolsFrontend(QSharedPointer<WebContentsAdapter> setLifecycleState(LifecycleState::Active); - m_devToolsFrontend = DevToolsFrontendQt::Show(frontendAdapter, m_webContents.get()); + content::WebContents *webContents = m_webContents.get(); + if (content::WebContents *guest = guestWebContents()) + webContents = guest; + m_devToolsFrontend = DevToolsFrontendQt::Show(frontendAdapter, webContents); updateRecommendedState(); } |