Adds app default option

Adds app defaults option for controlling link opening preferences.

Adds browser logic and images.

Browser Manager Updates

- Handles deletion of current browser
- Fixes detection of installed browsers by moving URL Types to LSApplicationQuery
- Updates icons to glyphs
- Context menus update

tidy up

- removes browser specific options and offers in-app or default browser options (can be enabled via a bool)
- adds 1Password as an option
- removes custom wording on context menus

Fixes

- makes sure browser options are available on iPad
- uses VibrantCell
- Changes Settings title to "Open Links In"
This commit is contained in:
Stuart Breckenridge
2021-08-22 09:42:06 +08:00
parent 656782ff9e
commit 08a1120e00
33 changed files with 803 additions and 80 deletions

View File

@@ -250,8 +250,12 @@ class WebViewController: UIViewController {
func openInAppBrowser() {
guard let url = article?.preferredURL else { return }
let vc = SFSafariViewController(url: url)
present(vc, animated: true)
if BrowserManager.shared.currentBrowser() == .inApp {
let vc = SFSafariViewController(url: url)
present(vc, animated: true)
} else {
BrowserManager.shared.openURL(urlString: url.absoluteString)
}
}
}
@@ -344,7 +348,12 @@ extension WebViewController: WKNavigationDelegate {
let components = URLComponents(url: url, resolvingAgainstBaseURL: false)
if components?.scheme == "http" || components?.scheme == "https" {
decisionHandler(.cancel)
openURL(url)
if BrowserManager.shared.currentBrowser() == .inApp {
openURL(url)
} else {
BrowserManager.shared.openURL(urlString: url.absoluteString)
}
} else if components?.scheme == "mailto" {
decisionHandler(.cancel)