How to get FavIcon of the current tab in macos(OSX) Swift

104 Views Asked by At

Using this code i am getting current url and tabName but i want Favicon of that current tab opened

let safariApplication = SBApplication(bundleIdentifier: "com.apple.Safari")! as SafariApplication
        self.windows = safariApplication.windows!().reduce([String: SafariWindow](), { (dictionary, object) -> [String: SafariWindow] in
            let window = object as! SafariWindow
            
            let tabName = window.name
            let safariTab = window.tabs?().object(withName: "\(tabName ?? "")")
            let url = (safariTab as AnyObject).URL
            
            urlValue = url ?? ""
            tabName1 = tabName ?? ""
            print(url ?? "")
            print(tabName ?? "")
            var dictionary = dictionary
            dictionary[window.name!] = window

            return dictionary
        })
0

There are 0 best solutions below