Pasteboard Privacy Preview in macOS 15.4
Apple (via Jeff Nadeau):
Prepare your app for an upcoming feature in macOS that alerts a person using a device when your app programmatically reads the general pasteboard. The system shows the alert only if the pasteboard access wasn’t a result of someone’s input on a UI element that the system considers paste-related. This behavior is similar to how
UIPasteboard
behaves in iOS. Newdetect
methods inNSPasteboard
andNSPasteboardItem
make it possible for an app to examine the kinds of data on the pasteboard without actually reading them and showing the alert.NSPasteboard
also adds anaccessBehavior
property to determine if programmatic pasteboard access is always allowed, never allowed, or if it prompts an alert requesting permission. You can adopt these APIs ahead of the change, and set a user default to test the new behavior on your Mac. To do so, launch Terminal and enter the commanddefaults write <your_app_bundle_id> EnablePasteboardPrivacyDeveloperPreview -bool yes
to enable the behavior for your app.
The Swift and Objective-C APIs are different.
Long ago when I was still at Apple I filed a radar suggesting something like this when I found out the Facebook iOS app would look into the pasteboard as soon as it was brought forward and suggest posting any URL the user might have there.
This is incredibly hard to get right since there’s no straightforward way for the OS to know if a paste op is legit.
Previously:
- macOS 15.4
- iOS 16.1: Per-App Copy-and-Paste Permissions
- Extra iOS 16 Paste Prompts
- iOS 14 Pasteboard Notifications
- iOS Apps Snooping on Pasteboard Data
6 Comments RSS · Twitter · Mastodon
I understand that reading the clipboard is a potential privacy leak, but for me the iOS notifications are the native app equivalent of cookie notices. Annoying friction that snaps me out of what I'm trying to do.
Here's a thought: allow us to decide which apps trigger this notification. Make it opt in, or at the very least opt out.
That's the sort of thing Apple would do if they were thoughtfully designing their OS, and were operating under the assumption that a computer is owned by you, and you should make decisions about how it works. Neither is true; they are evidently thoughtless, and as far as they're concerned, *they* own your computer, even though you paid money to purchase it from them.
Is this saying that an app can decide that regardless of the users wishes a clipboard cannot be read programatically?
That's not privacy, that allowing an application to dictate what a user can do on their own Mac!
This is a sensible idea that I don't trust Apple to implement with the proper nuance.
On one hand, I like the idea that the pasteboard is not "free for all", but on the other, so many cool things my Mac – and iOS cannot – come from that access:
1. I use Alfred's clipboard manager a couple dozen times a day;
2. A Keyboard Maestro macro (hi Peter!) monitors my pasteboard for Youtube links I copied and adds them to Unwatched automatically;
3. Different key combinations allow me to paste the content after some processing (i.e. copy a certain string, process it through a regex again in KM, paste only a section properly adapted).
4. I can see the current content of the pasteboard in the menubar thanks to an app I wrote a few years ago and that I imagine will now die.
5. Certainly many more things I'm not thinking about right now...
Take those thing away – or put them behind continuous Vista prompts – and you'll have magically dumbed down macOS to iPadOS level.
On a side, I *love* that while podcasts wish for clipboard managers on iPadOS, Apple makes things harder on the Mac. Because Users are not to be trusted, right?
The right way to make this would be to have a clear way to tell macOS "I trust this app" and actually make the operating system NOT bother you again.
Good Feedback submitted to Apple by Sindre Sorhus: [FB17587626: NSPasteboard needs a way to programmatically request full access to the pasteboard](https://github.com/feedback-assistant/reports/issues/655)
There is a new section in the "Privacy & Security" prefs called "Paste from Other Apps".
Once an app triggers the permission request for the first time, it appears in this list. Option can then be set to "Ask", "Allow", "Deny". The Allow setting allows full access as per the current status quo.
This pane can be opened using URL: "x-apple.systempreferences:com.apple.preference.security?Privacy_Pasteboard".
The preference can be reset using "tccutil reset Pasteboard "