diff options
author | Benjamin Terrier <b.terrier@gmail.com> | 2022-01-22 02:59:56 +0100 |
---|---|---|
committer | Benjamin Terrier <b.terrier@gmail.com> | 2022-01-27 16:18:40 +0100 |
commit | 8b5e3a46f253cd82dc48bc20c4233f1bf79fcb87 (patch) | |
tree | 0e130ed97d144a6ca6bf07420882707986cf9fdf /src/core/web_contents_delegate_qt.cpp | |
parent | adea3e2215a2927f9d16c701e023b91fb6781b47 (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
Pick-to: 6.3 6.2 5.15
Change-Id: Ie2c17127e1a00ffc515829526320ba2f71d45af5
Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-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()); |