From e1111168f0a9edb7f6e5976ab3951663c24abc86 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Sat, 23 May 2026 10:12:30 -0700 Subject: [PATCH] Fix sandboxing issues with default browser setting. --- Modules/RSWeb/Sources/RSWeb/MacWebBrowser.swift | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Modules/RSWeb/Sources/RSWeb/MacWebBrowser.swift b/Modules/RSWeb/Sources/RSWeb/MacWebBrowser.swift index e253601f5..d98407c0d 100755 --- a/Modules/RSWeb/Sources/RSWeb/MacWebBrowser.swift +++ b/Modules/RSWeb/Sources/RSWeb/MacWebBrowser.swift @@ -146,13 +146,9 @@ import UniformTypeIdentifiers return _bundleIdentifier } - private lazy var _bundlePath: String? = { - return Bundle(url: url)?.bundlePath - }() - - /// The bundle path of the web browser - public var bundlePath: String? { - return _bundlePath + /// The bundle path of the web browser. + public var bundlePath: String { + url.path } /// Initializes a `MacWebBrowser` with a URL on disk. @@ -173,13 +169,12 @@ import UniformTypeIdentifiers /// Initializes a `MacWebBrowser` from a path. /// - Parameter path: Path to the app, as in `/Applications/Firefox.app`. - /// - Returns: `nil` if no app exists at `path`. + /// - Returns: `nil` if nothing exists at `path`. public convenience init?(path: String) { - let url = URL(fileURLWithPath: path) - guard Bundle(url: url) != nil else { + guard FileManager.default.fileExists(atPath: path) else { return nil } - self.init(url: url) + self.init(url: URL(fileURLWithPath: path)) } /// Opens a URL in this browser.