Skip to content

armgit / peel

Public Imported from GitHub
0

Uninstall Mac apps with every file they leave behind, and see why each belongs. Free up space, fine-tune macOS, and set up Terminal.

Say that nothing loads a contextual menu item anymore

Țugui Dragoș389fbe5d0762
diff --git a/Localization/Peel/Localizable.xcstrings b/Localization/Peel/Localizable.xcstrings
index 66c7a4f4..09de1a4e 100644
--- a/Localization/Peel/Localizable.xcstrings
+++ b/Localization/Peel/Localizable.xcstrings
@@ -241798,6 +241798,112 @@
}
}
},
+ "macOS no longer loads contextual menu items like this one, so moving it changes nothing." : {
+ "localizations" : {
+ "cs" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "Systém macOS už nenačítá položky kontextové nabídky, jako je tato, takže její přesunutí nic nezmění."
+ }
+ },
+ "de" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS lädt Kontextmenü-Objekte wie dieses nicht mehr, daher ändert sich durch das Verschieben nichts."
+ }
+ },
+ "es" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS ya no carga ítems de menú contextual como este, así que trasladarlo no cambia nada."
+ }
+ },
+ "fr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS ne charge plus les éléments de menu contextuel tels que celui-ci : le déplacer ne change donc rien."
+ }
+ },
+ "it" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS non carica più gli elementi del menu contestuale come questo, quindi spostarlo non cambia nulla."
+ }
+ },
+ "ja" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOSはこのようなコンテクストメニュー項目を読み込まなくなったため、ゴミ箱に入れても何も変わりません。"
+ }
+ },
+ "ko" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS는 이와 같은 빠른 메뉴 항목을 더 이상 로드하지 않으므로, 이동해도 아무것도 달라지지 않습니다."
+ }
+ },
+ "nl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS laadt contextmenu-onderdelen zoals dit niet meer, dus als je het verplaatst, verandert er niets."
+ }
+ },
+ "pl" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS nie wczytuje już pozycji menu kontekstowego takich jak ta, więc przeniesienie tej wtyczki do Kosza niczego nie zmieni."
+ }
+ },
+ "pt" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "O macOS não carrega mais itens de menu contextual como este, então movê-lo não altera nada."
+ }
+ },
+ "ro" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS nu mai încarcă articole de meniu contextual precum acesta, așa că mutarea lui nu schimbă nimic."
+ }
+ },
+ "ru" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS больше не загружает пункты контекстного меню, подобные этому, поэтому его перемещение ничего не изменит."
+ }
+ },
+ "sv" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS läser inte längre in kontextmenyobjekt som det här, så om det flyttas ändras ingenting."
+ }
+ },
+ "tr" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS artık bunun gibi bağlamsal menü öğelerini yüklemiyor, bu yüzden onu taşımak hiçbir şeyi değiştirmez."
+ }
+ },
+ "uk" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS більше не завантажує такі елементи контекстного меню, як цей, тож його переміщення нічого не змінить."
+ }
+ },
+ "zh-Hans" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS已不再载入此类关联菜单项,因此移动它不会带来任何变化。"
+ }
+ },
+ "zh-Hant" : {
+ "stringUnit" : {
+ "state" : "translated",
+ "value" : "macOS已不再載入這類特色選單項目,因此移動它不會有任何影響。"
+ }
+ }
+ }
+ },
"macOS puts them on the Desktop. Choose somewhere else." : {
"localizations" : {
"cs" : {
diff --git a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
index 5cdfa046..02da6642 100644
--- a/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
+++ b/Packages/PeelCore/Sources/PeelCore/Plugins/Plugins.swift
@@ -58,6 +58,7 @@ public struct Plugin: Sendable, Hashable, Identifiable {
case quickLookGenerator
/// An Internet plug-in other than a WebKit plug-in.
case internetPlugIn
+ case contextualMenuItem
}
public var noLongerLoaded: NoLongerLoaded?
@@ -261,9 +262,12 @@ public enum Plugins {
/// Whether nothing on macOS loads the plug-in anymore. macOS no longer loads a Quick Look generator from another
/// maker (macOS 15 Release Notes), and from an Internet Plug-Ins folder WebKit loads only a WebKit plug-in, named
- /// `.webplugin` or of package type `WBPL` as `CFBundleGetPackageInfo` reads it, while browsers load none.
+ /// `.webplugin` or of package type `WBPL` as `CFBundleGetPackageInfo` reads it, while browsers load none. A 64-bit
+ /// app ignores contextual menu plug-ins (64-Bit Guide for Carbon Developers), and macOS runs no 32-bit app.
static func noLongerLoaded(_ url: URL, category: Plugin.Category) -> Plugin.NoLongerLoaded? {
switch category {
+ case .contextualMenuItems:
+ return .contextualMenuItem
case .quickLook:
return url.pathExtension.caseInsensitiveCompare("qlgenerator") == .orderedSame ? .quickLookGenerator : nil
case .internetPlugIns:
diff --git a/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift b/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
index 533132e8..51008023 100644
--- a/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
+++ b/Packages/PeelCore/Tests/PeelCoreTests/PluginsTests.swift
@@ -87,6 +87,21 @@ struct PluginsTests {
])
}
+ @Test func knowsNothingLoadsAContextualMenuItem() async throws {
+ let directory = try TemporaryDirectory()
+ try directory.directory("home/Library/Contextual Menu Items/Old Menu.plugin/Contents")
+ try directory.directory("root/Library/Contextual Menu Items/Vendor Menu.plugin/Contents")
+ let environment = SearchEnvironment(
+ homeDirectory: directory.url.appending(path: "home", directoryHint: .isDirectory),
+ rootDirectory: directory.url.appending(path: "root", directoryHint: .isDirectory)
+ )
+
+ let plugins = await Plugins.scan(environment: environment).plugins
+
+ #expect(plugins.map(\.name) == ["Old Menu", "Vendor Menu"])
+ #expect(plugins.allSatisfy { $0.noLongerLoaded == .contextualMenuItem })
+ }
+
@Test func saysWhichAppAPlugInCameWith() {
let surge = InstalledApp(
url: URL(filePath: "/Applications/Surge XT.app"), bundleIdentifier: "org.example.surgext", name: "Surge XT"
diff --git a/Peel/Views/Plugins/PluginDetailView.swift b/Peel/Views/Plugins/PluginDetailView.swift
index c0b42596..11251a91 100644
--- a/Peel/Views/Plugins/PluginDetailView.swift
+++ b/Peel/Views/Plugins/PluginDetailView.swift
@@ -154,6 +154,8 @@ extension Plugin {
"macOS no longer loads Quick Look generators like this one, so moving it changes nothing."
case .internetPlugIn:
"macOS and today’s browsers no longer load plug-ins like this one, so moving it changes nothing."
+ case .contextualMenuItem:
+ "macOS no longer loads contextual menu items like this one, so moving it changes nothing."
case nil:
category == .cameraPlugIns
? "macOS loads plug-ins like this one only when legacy video device support has been restored in macOS Recovery. If it has, apps that use it may stop working."
diff --git a/PeelTests/PluginTextTests.swift b/PeelTests/PluginTextTests.swift
index d96c138e..433450fa 100644
--- a/PeelTests/PluginTextTests.swift
+++ b/PeelTests/PluginTextTests.swift
@@ -62,6 +62,21 @@ struct PluginTextTests {
#expect(echo.whenMoved.map { String(localized: $0) } == [String(localized: "Apps that use it may stop working.")])
}
+ @Test func saysNothingLoadsAContextualMenuItem() {
+ var menu = plugin(
+ "/Library/Contextual Menu Items/Old Menu.plugin", name: "Old Menu", forAllUsers: true,
+ category: .contextualMenuItems
+ )
+ menu.noLongerLoaded = .contextualMenuItem
+ menu.staysInTheTrash = true
+
+ #expect(menu.whenMoved.map { String(localized: $0) } == [
+ String(localized: "macOS no longer loads contextual menu items like this one, so moving it changes nothing."),
+ String(localized: "History can’t put it back, since Peel’s helper puts back into that folder only what is root’s alone, but you can drag it back out in Finder."),
+ String(localized: "Every account on this Mac has it, so moving it takes it from all of them."),
+ ])
+ }
+
@Test func saysWhenMacOSLoadsACameraPlugIn() {
let camera = plugin(
"/Library/CoreMediaIO/Plug-Ins/DAL/Lens.plugin", name: "Lens", forAllUsers: true, category: .cameraPlugIns