Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.
Swift cache-cleanercleanerclideveloper-toolsdisk-cleanupdisk-spaceduplicate-finderhomebrewliquid-glassmac-cleanermacosmacos-appmacos-golden-gatemacos-tahoemacos-tweaksswiftswiftuiterminal-themesuninstalluninstaller
Leave WebKit's own folders and cookie store to macOS
Țugui Dragoșf103533111a6
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4b4ff6ce..585512fc 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -190,8 +190,9 @@ its changes the way [Keep a Changelog](https://keepachangelog.com/) suggests.another program's identifier, such as Microsoft AutoUpdate's cache in `/Library/Caches`: it holds nothing of theapp's.- An app named like something macOS keeps for its own services, such as `Knowledge` in Application Support,- `GeoServices` in Caches, `Assistant` in Logs, or `Logging` in `/Library/Preferences`, no longer takes it: the app's- page, `peel leftovers`, and `peel uninstall` leave it to macOS, whatever a Homebrew cask names.+ `GeoServices` in Caches, `Assistant` in Logs, `Logging` in `/Library/Preferences`, WebKit's `Databases`, or the+ cookie store `Cookies.binarycookies`, no longer takes it: the app's page, `peel leftovers`, and `peel uninstall` leave+ it to macOS, whatever a Homebrew cask names.#### Orphaned Filesdiff --git a/Packages/PeelCore/Sources/PeelCore/Leftovers/SystemFolders.swift b/Packages/PeelCore/Sources/PeelCore/Leftovers/SystemFolders.swiftindex cbde2c5a..633913dc 100644--- a/Packages/PeelCore/Sources/PeelCore/Leftovers/SystemFolders.swift+++ b/Packages/PeelCore/Sources/PeelCore/Leftovers/SystemFolders.swift@@ -239,6 +239,17 @@ enum SystemFolders {"Xsan": .file("/System/Library/ConfigurationProfiles/PlugIns/xsanplugin.profileDomainPlugin/Contents/MacOS/xsanplugin", naming: "Library/Preferences/Xsan"),]+ static let webKit: [String: Proof] = [+ "Databases": .image("/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy", naming: "~/Library/WebKit/Databases"),+ "JavaScriptCoreDebug": .image("/System/Library/PrivateFrameworks/Safari.framework/Versions/A/Safari", naming: "~/Library/WebKit/JavaScriptCoreDebug"),+ "LocalStorage": .image("/System/Library/PrivateFrameworks/SafariSharedUI.framework/Versions/A/SafariSharedUI", naming: "~/Library/WebKit/LocalStorage"),+ "MediaKeys": .image("/System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy", naming: "~/Library/WebKit/MediaKeys"),+ ]++ static let cookies: [String: Proof] = [+ "Cookies.binarycookies": .image("/System/Library/Frameworks/WebKit.framework/Versions/A/WebKit", naming: "Cookies.binarycookies"),+ ]+/// Whether macOS keeps an item called `fileName` for its own services in a folder of `kind`. A process keeps its/// caches, its HTTP storage and its temporary items under the same name.static func keeps(_ fileName: String, in kind: SearchLocation.Kind) -> Bool {@@ -247,6 +258,8 @@ enum SystemFolders {case .caches, .httpStorages, .temporaryItems: cachesNamescase .logs: logsNamescase .preferences: preferencesNames+ case .webKit: webKitNames+ case .cookies: cookiesNamesdefault: noNames}return names.hold(fileName)@@ -256,6 +269,8 @@ enum SystemFolders {private static let cachesNames = Names(caches)private static let logsNames = Names(logs)private static let preferencesNames = Names(preferences)+ private static let webKitNames = Names(webKit)+ private static let cookiesNames = Names(cookies)private static let noNames = Names([:])/// The names of one list, lowercased, those with a `*` read as patterns.diff --git a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverMatcherTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverMatcherTests.swiftindex db72e2b6..ab2ae804 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/LeftoverMatcherTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/LeftoverMatcherTests.swift@@ -713,4 +713,14 @@ struct LeftoverMatcherTests {#expect(match("Knowledge", in: .caches, for: knowledge)?.isRecommended == true)#expect(match("Assistant", in: .applicationSupport, for: assistant)?.isRecommended == true)}++ @Test func whatWebKitKeepsUnderAPlainNameIsNoAppsByThatName() {+ let databases = app("org.example.databases", name: "Databases")+ let cookies = app("org.example.cookies", name: "Cookies")++ #expect(match("Databases", in: .webKit, for: databases) == nil)+ #expect(match("LocalStorage", in: .webKit, for: app("org.example.localstorage", name: "LocalStorage")) == nil)+ #expect(match("Cookies.binarycookies", in: .cookies, for: cookies) == nil)+ #expect(match("Databases", in: .caches, for: databases)?.isRecommended == true)+ }}diff --git a/Packages/PeelCore/Tests/PeelCoreTests/SystemFoldersTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/SystemFoldersTests.swiftindex d5d3d9ac..cdcad17d 100644--- a/Packages/PeelCore/Tests/PeelCoreTests/SystemFoldersTests.swift+++ b/Packages/PeelCore/Tests/PeelCoreTests/SystemFoldersTests.swift@@ -6,6 +6,7 @@ struct SystemFoldersTests {@Test func everyNameIsProvedByTheSealedSystem() throws {let lists = [SystemFolders.applicationSupport, SystemFolders.caches, SystemFolders.logs, SystemFolders.preferences,+ SystemFolders.webKit, SystemFolders.cookies,]for (name, proof) in lists.joined() {switch proof {diff --git a/SAFETY.md b/SAFETY.mdindex 1ec901c6..d22dff69 100644--- a/SAFETY.md+++ b/SAFETY.md@@ -332,9 +332,9 @@ Only matches Peel is `certain` or `likely` about, and only when nothing else insadministrator, such as a folder Xcode installed that is named for Chrome.- **What macOS keeps under a plain name stays macOS's.** macOS's own services keep some folders and files in yourLibrary and the Mac's under plain names, such as `Application Support/Knowledge`, `Caches/GeoServices`,- `Logs/Assistant`, or `/Library/Preferences/Logging`. An app called by the same name never takes one, and Orphaned- Files never lists one once such an app is gone. Peel knows each from macOS itself: a part of the system called by- that name, or one that names the path.+ `Logs/Assistant`, `/Library/Preferences/Logging`, WebKit's `WebKit/Databases`, or `Cookies/Cookies.binarycookies`. An+ app called by the same name never takes one, and Orphaned Files never lists one once such an app is gone. Peel knows+ each from macOS itself: a part of the system called by that name, or one that names the path.- **An empty folder of the app's maker goes too.** A folder in your Library or the Mac's named for the app or itsmaker, such as `Application Support/<Maker>`, that an uninstall leaves empty goes to the Trash with it, through thehelper when its files went that way; one with anything left inside, a hidden file included, one with another name,