Skip to content

Commit

Permalink
Make sure to clean HSTS and Alt Services dbs (#2647)
Browse files Browse the repository at this point in the history
Task/Issue URL: https://app.asana.com/0/0/1206930304246724/f
Tech Design URL:
CC:

Description:

Clean up HSTS and Alt Services.
  • Loading branch information
bwaresiak authored Apr 4, 2024
1 parent 760b58a commit ad2ec85
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Core/WebCacheManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,17 @@ extension WebCacheManager {
}
let dataStore = WKWebsiteDataStore.default()
let cookies = await dataStore.httpCookieStore.allCookies()
await dataStore.removeData(ofTypes: WKWebsiteDataStore.allWebsiteDataTypes(), modifiedSince: .distantPast)
var types = WKWebsiteDataStore.allWebsiteDataTypes()
types.insert("_WKWebsiteDataTypeMediaKeys")
types.insert("_WKWebsiteDataTypeHSTSCache")
types.insert("_WKWebsiteDataTypeSearchFieldRecentSearches")
types.insert("_WKWebsiteDataTypeResourceLoadStatistics")
types.insert("_WKWebsiteDataTypeCredentials")
types.insert("_WKWebsiteDataTypeAdClickAttributions")
types.insert("_WKWebsiteDataTypePrivateClickMeasurements")
types.insert("_WKWebsiteDataTypeAlternativeServices")

await dataStore.removeData(ofTypes: types, modifiedSince: .distantPast)
self.removeObservationsData()
timeoutTask.cancel()
return cookies
Expand Down

0 comments on commit ad2ec85

Please sign in to comment.