@capgo/inappbrowser 6.0.45 → 6.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -51,12 +51,17 @@ public class InAppBrowserPlugin: CAPPlugin {
|
|
|
51
51
|
|
|
52
52
|
@objc func clearCookies(_ call: CAPPluginCall) {
|
|
53
53
|
let dataStore = WKWebsiteDataStore.default()
|
|
54
|
-
let urlString = call.getString("url"
|
|
55
|
-
let clearCache = call.getBool("cache"
|
|
54
|
+
let urlString = call.getString("url", "")
|
|
55
|
+
let clearCache = call.getBool("cache", false)
|
|
56
56
|
|
|
57
57
|
if clearCache {
|
|
58
58
|
URLCache.shared.removeAllCachedResponses()
|
|
59
59
|
}
|
|
60
|
+
if (urlString.isEmpty) {
|
|
61
|
+
HTTPCookieStorage.shared.cookies?.forEach(HTTPCookieStorage.shared.deleteCookie)
|
|
62
|
+
call.resolve()
|
|
63
|
+
return
|
|
64
|
+
}
|
|
60
65
|
|
|
61
66
|
guard let url = URL(string: urlString), let hostName = url.host else {
|
|
62
67
|
call.reject("Invalid URL")
|