diff options
author | Benjamin Terrier <b.terrier@gmail.com> | 2022-01-22 02:59:56 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-28 02:17:48 +0000 |
commit | 477d47145865e43c795e7e580eba7f650375302a (patch) | |
tree | 4f59dd599a6ab9a75f5a88fb945f76719d96b01b /src/core | |
parent | b10414d8bbdaeb4523ec5db512cc096a2afd059a (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>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 2 |
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 ef79c8f47..8987403a5 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -360,7 +360,7 @@ void WebContentsDelegateQt::DidStartNavigation(content::NavigationHandle *naviga if (!webEngineSettings()->testAttribute(QWebEngineSettings::ErrorPageEnabled)) navigation_handle->SetSilentlyIgnoreErrors(); - if (!navigation_handle->IsInMainFrame() || !web_contents()->IsLoadingToDifferentDocument()) + if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSameDocument()) return; m_loadingInfo.url = toQt(navigation_handle->GetURL()); |