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.