diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-05-24 16:56:41 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-05-26 07:21:23 +0000 |
commit | 8d0bd4b1a18ff886f360e71942f95858b5995ba3 (patch) | |
tree | 766d2254b04af7c018c92cf7d84eed23e32a7295 /src/core | |
parent | 524c3c0f26209f22911a980d793f13d8e6fc1887 (diff) |
Fix local->remote user navigation
Specifically allow user initiated navigation of the mainframe.
Fixes: QTBUG-103778
Change-Id: I4e3d6b4fb606bd0c3cf66e090fba3c97c8c535b4
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
(cherry picked from commit 2ba1f04b4589e5883a399b022b7795266c4d4646)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/net/proxying_url_loader_factory_qt.cpp | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp index 39630cf2d..ba2051d60 100644 --- a/src/core/net/proxying_url_loader_factory_qt.cpp +++ b/src/core/net/proxying_url_loader_factory_qt.cpp @@ -280,10 +280,23 @@ void InterceptedRequest::Restart() // Check if non-local access is allowed if (!allow_remote_ && remote_access_) { - target_client_->OnComplete(network::URLLoaderCompletionStatus(net::ERR_NETWORK_ACCESS_DENIED)); - delete this; - return; + bool granted_special_access = false; + switch (ui::PageTransition(request_.transition_type)) { + case ui::PAGE_TRANSITION_LINK: + case ui::PAGE_TRANSITION_TYPED: + if (blink::mojom::ResourceType(request_.resource_type) == blink::mojom::ResourceType::kMainFrame && request_.has_user_gesture) + granted_special_access = true; // allow normal explicit navigation + break; + default: + break; + } + if (!granted_special_access) { + target_client_->OnComplete(network::URLLoaderCompletionStatus(net::ERR_NETWORK_ACCESS_DENIED)); + delete this; + return; + } } + // Check if local access is allowed if (!allow_local_ && local_access_) { bool granted_special_access = false; |