diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-08-20 14:31:24 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-24 18:00:14 +0000 |
commit | eca9bfdeba9b404d14fcc5df36c05c936bb6dc51 (patch) | |
tree | 3e2a4315659a0701c1ea8369165906a1292dbb02 | |
parent | cba74c389e68ab1412f26a8a7d1a42f92aa36e83 (diff) |
Fix devtools internal reattach
We were replacing the devtools with a new one instead of reattaching.
Change-Id: I7729b2e1fcc2946d8d5d67acbf026a06e8cbdc06
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Balazs Egedi <egedib@inf.u-szeged.hu>
(cherry picked from commit e283b265257969acb97d9e7c928c9949e860282f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/core/devtools_frontend_qt.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp index 440c52d33..81701b631 100644 --- a/src/core/devtools_frontend_qt.cpp +++ b/src/core/devtools_frontend_qt.cpp @@ -296,7 +296,7 @@ void DevToolsFrontendQt::ReadyToCommitNavigation(content::NavigationHandle *navi // If the frontend for some reason goes to some place other than devtools, stop the bindings if (navigationHandle->GetURL() != GetFrontendURL()) m_frontendHost.reset(nullptr); - else + else if (!m_frontendHost) m_frontendHost = content::DevToolsFrontendHost::Create( frame, base::Bind(&DevToolsFrontendQt::HandleMessageFromDevToolsFrontend, @@ -488,6 +488,8 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"), base::NullCallback()); } else if (method == "reattach") { + if (!m_agentHost) + return; m_agentHost->DetachClient(this); m_agentHost->AttachClient(this); } else if (method == "inspectedURLChanged" && params && params->GetSize() >= 1) { |