summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-10 21:37:08 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-01-10 21:37:08 +0100
commitf2e136c1a16bf2fe3a9ebe392fddd34ad83caede (patch)
treef98a6d534e6e58d52b5c96095a485d923763ec5e
parent9583ee9ff9c9408475cf90694d6e767cb21de792 (diff)
parentbb7b87f584128bfa5325921a60e80e3d03f9e194 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts: .qmake.conf Change-Id: I69cc1cd1d3acd8e3e55b121449ff2bca5cd87bb3
-rw-r--r--src/plugins/darwin/qdarwinwebview.mm8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/plugins/darwin/qdarwinwebview.mm b/src/plugins/darwin/qdarwinwebview.mm
index e82771f..ba99ac6 100644
--- a/src/plugins/darwin/qdarwinwebview.mm
+++ b/src/plugins/darwin/qdarwinwebview.mm
@@ -244,7 +244,13 @@ decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
#ifdef Q_OS_MACOS
[[NSWorkspace sharedWorkspace] openURL:url];
#elif defined(Q_OS_IOS)
- [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
+ // Check if it can be opened first, if it is a file scheme then it can't
+ // be opened, therefore if it is a _blank target in that case we need to open
+ // inside the current webview
+ if ([[UIApplication sharedApplication] canOpenURL:url])
+ [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
+ else if (!navigationAction.targetFrame)
+ [webView loadRequest:navigationAction.request];
#endif
}
decisionHandler(handled ? WKNavigationActionPolicyAllow : WKNavigationActionPolicyCancel);