diff --git a/Tusker/Screens/Preferences/BehaviorPrefsView.swift b/Tusker/Screens/Preferences/BehaviorPrefsView.swift index 0a68fdb2..a2d9ea58 100644 --- a/Tusker/Screens/Preferences/BehaviorPrefsView.swift +++ b/Tusker/Screens/Preferences/BehaviorPrefsView.swift @@ -57,12 +57,14 @@ struct BehaviorPrefsView: View { Toggle(isOn: $preferences.openLinksInApps) { Text("Open Links in Apps") } + #if !os(visionOS) Toggle(isOn: $preferences.useInAppSafari) { Text("Use In-App Safari") } Toggle(isOn: $preferences.inAppSafariAutomaticReaderMode) { Text("Always Use Reader Mode in In-App Safari") }.disabled(!preferences.useInAppSafari) + #endif } .appGroupedListRowBackground() } diff --git a/Tusker/TuskerNavigationDelegate.swift b/Tusker/TuskerNavigationDelegate.swift index 9ee7ee84..eb3be9c0 100644 --- a/Tusker/TuskerNavigationDelegate.swift +++ b/Tusker/TuskerNavigationDelegate.swift @@ -46,14 +46,15 @@ extension TuskerNavigationDelegate { func selected(url: URL, allowResolveStatuses: Bool = true, allowUniversalLinks: Bool = true) { func openSafari() { + #if os(visionOS) + UIApplication.shared.open(url) + #else if Preferences.shared.useInAppSafari, url.scheme == "https" || url.scheme == "http" { let config = SFSafariViewController.Configuration() config.entersReaderIfAvailable = Preferences.shared.inAppSafariAutomaticReaderMode let vc = SFSafariViewController(url: url, configuration: config) - #if !os(visionOS) vc.preferredControlTintColor = Preferences.shared.accentColor.color - #endif present(vc, animated: true) } else if UIApplication.shared.canOpenURL(url) { UIApplication.shared.open(url, options: [:]) @@ -66,6 +67,7 @@ extension TuskerNavigationDelegate { alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) present(alert, animated: true) } + #endif } if allowResolveStatuses,