Web-Facing Change PSA: Enable clipboard access via Async Clipboard API in event handlers

178 views
Skip to first unread message

Evan Stade

unread,
Jan 10, 2024, 7:19:10 PMJan 10
to blink-dev

Contact emails

est...@chromium.org

Specification

https://www.w3.org/TR/clipboard-apis/#read-permission

Summary

This change removes the requirement for the "clipboard-read" permission when using the Async Clipboard API from within a "paste" event handler. It also applies to writing to the clipboard inside a "copy" or "cut" event, although writing plain text to the clipboard was already permitted on ANY user gesture, so this is a less notable change. Browser vendors differ in the details of how they permit access to the Async Clipboard API, but this change brings Chromium into alignment with other vendors and the specification [1] which states that read access is to be permitted when > the current script is running as a result of user interaction with a "Paste" element created by the user agent or operating system. [1] https://www.w3.org/TR/clipboard-apis/



Blink component

Blink>DataTransfer

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

Improves interop by aligning Chromium behavior more closely to other browser vendors. (Other vendors don't use permissions at all, but allow access to the API in appropriate event handlers, and Chromium will now follow suit on the latter point.)



Gecko: No signal

WebKit: No signal

Web developers: positive

Other signals:

Ergonomics

The Async Clipboard API might be used in tandem with the permissions API. This change affects how often the clipboard permissions are actually relevant. For example, the permission status is no longer relevant if the intended usage is inside a "paste" event handler. This could lead to a situation where an existing in-situ message warning/preparing users about an impending permission prompt are no longer required.



WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

Yes

Is this feature fully tested by web-platform-tests?

No

Currently only tested by internal WPT due to hurdle of updating test-driver



Flag name on chrome://flags

None

Finch feature name

AsyncClipboardImplicitPermission

Requires code in //chrome?

False

Sample links


https://jsfiddle.net/evanstade/zbp98vj5/8

Estimated milestones

Shipping on desktop122
Shipping on Android122


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5167870134976512

This intent message was generated by Chrome Platform Status.

-- Evan Stade
Reply all
Reply to author
Forward
0 new messages