diff --git a/Mac/Browser.swift b/Mac/Browser.swift index 5f8b7a0ee..d574bc7ad 100644 --- a/Mac/Browser.swift +++ b/Mac/Browser.swift @@ -43,7 +43,17 @@ struct Browser { /// - Note: Some browsers (specifically Chromium-derived ones) will ignore the request /// to open in the background. static func open(_ urlString: String, inBackground: Bool) { - if let url = URL(unicodeString: urlString) { + guard let url = URL(unicodeString: urlString), let preparedURL = url.preparedForOpeningInBrowser() else { return } + + let configuration = NSWorkspace.OpenConfiguration() + configuration.requiresUniversalLinks = true + configuration.promptsUserIfNeeded = false + if inBackground { + configuration.activates = false + } + + NSWorkspace.shared.open(preparedURL, configuration: configuration) { (runningApplication, error) in + guard error != nil else { return } if let defaultBrowser = defaultBrowser { defaultBrowser.openURL(url, inBackground: inBackground) } else { diff --git a/NetNewsWire.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/NetNewsWire.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index b58a85312..4117254f5 100644 --- a/NetNewsWire.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/NetNewsWire.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "repositoryURL": "https://github.com/Thomvis/BrightFutures.git", "state": { "branch": null, - "revision": "9279defa6bdc21501ce740266e5a14d0119ddc63", - "version": "8.0.1" + "revision": "939858b811026f85e87847a808f0bea2f187e5c4", + "version": "8.1.0" } }, { @@ -33,8 +33,8 @@ "repositoryURL": "https://github.com/tid-kijyun/Kanna.git", "state": { "branch": null, - "revision": "c657fb9f5827ef138068215c76ad0bb62bbc92da", - "version": "5.2.4" + "revision": "f9e4922223dd0d3dfbf02ca70812cf5531fc0593", + "version": "5.2.7" } }, { @@ -51,8 +51,8 @@ "repositoryURL": "https://github.com/microsoft/plcrashreporter.git", "state": { "branch": null, - "revision": "de6b8f9db4b2a0aa859a5507550a70548e4da936", - "version": "1.8.1" + "revision": "d747ab5de269cd44022bbe96ff9609d8626694ab", + "version": "1.9.0" } }, { @@ -60,8 +60,8 @@ "repositoryURL": "https://github.com/Ranchero-Software/RSCore.git", "state": { "branch": null, - "revision": "2a13519b4d91843faa6aff4245b0e387dc64eafe", - "version": "1.0.6" + "revision": "060b12a3d3b6d27d57b2fae84160bfec91ec7118", + "version": "1.0.7" } }, { @@ -96,8 +96,8 @@ "repositoryURL": "https://github.com/Ranchero-Software/RSWeb.git", "state": { "branch": null, - "revision": "2f9ad98736c5c17dfb2be0b3cc06e71a49b061fa", - "version": "1.0.1" + "revision": "2f7849a9ad2cb461b3d6c9c920e163596e6b5d7b", + "version": "1.0.3" } }, { diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index cba86084f..232d62db1 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -351,8 +351,13 @@ extension WebViewController: WKNavigationDelegate { if AppDefaults.shared.useSystemBrowser { UIApplication.shared.open(url, options: [:]) } else { - let vc = SFSafariViewController(url: url) - self.present(vc, animated: true, completion: nil) + UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { didOpen in + guard didOpen == false else { + return + } + let vc = SFSafariViewController(url: url) + self.present(vc, animated: true) + } } } else if components?.scheme == "mailto" {