#if os(macOS)import SweetCookieKitpublic typealias BrowserCookieImportOrder = [Browser]#elsepublic struct Browser: Sendable, Hashable { public init() {}}public typealias BrowserCookieImportOrder = [Browser]#endifextension [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) } }}
#if os(macOS)
import SweetCookieKit
public typealias BrowserCookieImportOrder = [Browser]
#else
public 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) }
}
}