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-27 23:50:31 +0000 |
commit | 0588e7bae9d8042ef9b341192ef0b765e3cd9f26 (patch) | |
tree | f3389d9b7a451981e3a6667497d799f9933bdbd7 /src | |
parent | dbdcf5800377f0611d399275521cfce4fec33e27 (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')
-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 014bbe744..885f58149 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -364,7 +364,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()); |