mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-10 01:27:43 +00:00
Merge pull request #4022 from keymanapp/fix/ios/package-links-are-internal
fix(ios): package-internal links should be considered internal
This commit is contained in:
commit
d0313e8337
1 changed files with 6 additions and 1 deletions
|
|
@ -90,7 +90,12 @@ class PackageWebViewController: UIViewController, WKNavigationDelegate {
|
|||
decidePolicyFor navigationAction: WKNavigationAction,
|
||||
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
|
||||
if let link = navigationAction.request.url {
|
||||
if UniversalLinks.isExternalLink(link) {
|
||||
if link.path.hasPrefix(self.package.sourceFolder.path) {
|
||||
// Links from within the package will show up as 'external' in the condition below!
|
||||
// So, we check against package-internal links first.
|
||||
decisionHandler(.allow)
|
||||
return
|
||||
} else if UniversalLinks.isExternalLink(link) {
|
||||
decisionHandler(.cancel)
|
||||
|
||||
// Kick this link out to an external Safari process.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue