mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Adds handling of tel url schemes
This commit is contained in:
@@ -314,7 +314,7 @@ extension WebViewController: WKNavigationDelegate {
|
||||
} else if components?.scheme == "mailto" {
|
||||
decisionHandler(.cancel)
|
||||
|
||||
guard let emailAddress = components?.url?.emailAddress else {
|
||||
guard let emailAddress = url.emailAddress else {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -328,6 +328,13 @@ extension WebViewController: WKNavigationDelegate {
|
||||
alert.addAction(.init(title: "Dismiss", style: .cancel, handler: nil))
|
||||
self.present(alert, animated: true, completion: nil)
|
||||
}
|
||||
} else if components?.scheme == "tel" {
|
||||
decisionHandler(.cancel)
|
||||
|
||||
if UIApplication.shared.canOpenURL(url) {
|
||||
UIApplication.shared.open(url, options: [.universalLinksOnly : false], completionHandler: nil)
|
||||
}
|
||||
|
||||
} else {
|
||||
decisionHandler(.allow)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user