summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-04-14 13:35:19 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-04-19 13:54:51 +0000
commitb29b245fcb9db741d14180ea7e8dcb3ad2d4f49a (patch)
tree15d2cc67de6d23c5592ee17e62af9c0eb0ef3698 /src/core
parentb5834447f319a43d1bf143c9d2d96d6fcb6dbea9 (diff)
Report server directs in navigation type
A server redirect might not have been reflected in the navigation type at this point, so also check the is_redirect value. Pick-to: 5.15.4 Fixes: QTBUG-92819 Change-Id: I711ef041de69552bc3485c9cf3db68c9e6033d6a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/content_browser_client_qt.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index da1ea8dde..76f94c61f 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -1005,7 +1005,13 @@ static bool navigationThrottleCallback(content::WebContents *source,
WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(source)->GetView())->client();
if (!client)
return false;
- client->navigationRequested(pageTransitionToNavigationType(params.transition_type()),
+
+ // Redirects might not be reflected in transition_type at this point (see also chrome/.../web_navigation_api_helpers.cc)
+ auto transition_type = params.transition_type();
+ if (params.is_redirect())
+ transition_type = ui::PageTransitionFromInt(transition_type | ui::PAGE_TRANSITION_SERVER_REDIRECT);
+
+ client->navigationRequested(pageTransitionToNavigationType(transition_type),
toQt(params.url()),
navigationRequestAction,
params.is_main_frame());