Skip to content

Commit 529610d

Browse files
committed
fixed decidePolicyFor API
1 parent 584f8c8 commit 529610d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ChangelogKit/Classes/Views/WebViewController.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ extension WebViewController: WKNavigationDelegate {
183183
func webView(_ webView: WKWebView,
184184
decidePolicyFor navigationAction: WKNavigationAction,
185185
decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
186+
if navigationAction.targetFrame == nil, let url = navigationAction.request.url {
187+
if UIApplication.shared.canOpenURL(url) {
188+
UIApplication.shared.open(url, options: [:], completionHandler: nil)
189+
}
190+
}
186191
decisionHandler(.allow)
187192
}
188193
}

0 commit comments

Comments
 (0)