25 lines · 835 B · Swift
RawDownload
#if os(macOS)import SweetCookieKit public typealias BrowserCookieImportOrder = [Browser]#elsepublic struct Browser: Sendable, Hashable {    public init() {}} public typealias BrowserCookieImportOrder = [Browser]#endif extension [Browser] {    /// Filters a browser list to sources worth attempting for cookie imports.    ///    /// This is intentionally stricter than "app installed": it aims to avoid unnecessary Keychain prompts.    public func cookieImportCandidates(using detection: BrowserDetection) -> [Browser] {        self.filter { detection.isCookieSourceAvailable($0) }    }     /// Filters a browser list to sources with usable profile data on disk.    public func browsersWithProfileData(using detection: BrowserDetection) -> [Browser] {        self.filter { detection.hasUsableProfileData($0) }    }}