Disallow opening universal links from Open in Safari context menu action

This commit is contained in:
Shadowfacts 2020-08-15 17:48:58 -04:00
parent af300a3559
commit 090746f292
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 3 additions and 3 deletions

View File

@ -185,7 +185,7 @@ extension MenuPreviewProvider {
private func openInSafariAction(url: URL) -> UIAction {
return createAction(identifier: "openinsafari", title: "Open in Safari", systemImageName: "safari", handler: { (_) in
self.navigationDelegate?.selected(url: url)
self.navigationDelegate?.selected(url: url, allowUniversalLinks: false)
})
}

View File

@ -42,7 +42,7 @@ extension TuskerNavigationDelegate {
show(HashtagTimelineViewController(for: tag, mastodonController: apiController), sender: self)
}
func selected(url: URL) {
func selected(url: URL, allowUniversalLinks: Bool = true) {
func openSafari() {
if Preferences.shared.useInAppSafari {
let config = SFSafariViewController.Configuration()
@ -53,7 +53,7 @@ extension TuskerNavigationDelegate {
}
}
if (Preferences.shared.openLinksInApps) {
if allowUniversalLinks && Preferences.shared.openLinksInApps {
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { (success) in
if (!success) {
openSafari()