This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import WebKit | |
final class WebCacheCleaner { | |
class func clean() { | |
HTTPCookieStorage.shared.removeCookies(since: Date.distantPast) | |
print("[WebCacheCleaner] All cookies deleted") | |
WKWebsiteDataStore.default().fetchDataRecords(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes()) { records in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Visual Effects View in SwiftUI, AppKit | |
// cf. https://gist.github.com/edwurtle/98c33bc783eb4761c114fcdcaac8ac71#file-blur-swift | |
import SwiftUI | |
struct NSBlur: NSViewRepresentable { | |
var blendingMode: NSVisualEffectView.BlendingMode = .withinWindow | |
func makeNSView(context: Context) -> NSVisualEffectView { | |
let view = NSVisualEffectView() | |
view.blendingMode = blendingMode |