summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Terrier <b.terrier@gmail.com>2022-01-22 02:59:56 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-28 10:06:30 +0000
commit73e76f9e86b3fded45be6b232bdebe75e7136e4a (patch)
treec108be5def66aa881912760f7de6e7473d8decf6
parentcd2b9fa576bc252740a873ca8372a4f61fb96269 (diff)
Use IsSameDocument() rather than IsLoadingToDifferentDocument()
For certain types of redirect navigations (for example, with a non-default useragent set) 'IsLoadingToDifferentDocument()' can be unexpectedly false. In such cases 'navigation_handle->IsSameDocument()' also returns false. Fixes: QTBUG-94924 Change-Id: Ie2c17127e1a00ffc515829526320ba2f71d45af5 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io> (cherry picked from commit 8b5e3a46f253cd82dc48bc20c4233f1bf79fcb87) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/core/web_contents_delegate_qt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index d52b07df3..e7bfa6510 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -354,7 +354,7 @@ void WebContentsDelegateQt::DidStartNavigation(content::NavigationHandle *naviga
if (!webEngineSettings()->testAttribute(WebEngineSettings::ErrorPageEnabled))
navigation_handle->SetSilentlyIgnoreErrors();
- if (!navigation_handle->IsInMainFrame() || !web_contents()->IsLoadingToDifferentDocument())
+ if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSameDocument())
return;
m_faviconManager->resetCandidates();