sni...@microsoft.com, est...@chromium.org, sa...@microsoft.com, jsb...@google.com
https://docs.google.com/document/d/1OLVOESy3zecxY_6jMKdKVxeIGS2Q6mDmzc85rUNrRIE/edit?usp=sharing
https://w3c.github.io/clipboard-apis/#dom-clipboard-read
When the system clipboard is either empty or has unsupported formats, paste event returns an empty DataTransfer object, but the promise for `navigator.clipboard.read()`API is rejected. This creates interop differences and confusion among web developers as they aren’t sure why read failed.
Currently in Chrome, we throw a DataError. The proposal here is to return an empty ClipboardItem when the system clipboard is either empty or there aren’t any supported formats.
AsyncClipboardAPI, ClipboardItem
None
Not applicable
It satisfies one of the criterias for exception. This change has already been shipped in Safari and Firefox has also implemented it. The spec already allows empty ClipboardItem during read so it doesn’t need any update.
None. Safari has shipped this feature and Firefox has already implemented it.
Gecko: Positive (https://github.com/w3c/clipboard-apis/issues/179#issuecomment-1211995581)
WebKit: Shipped/Shipping (https://github.com/w3c/clipboard-apis/issues/179#issuecomment-1804303784)
Web developers: Positive This was a feedback from our partners at Office who are migrating from DataTransfer API to Async Clipboard API.
Other signals:
N/A
N/A
None. The proposal only returns an empty ClipboardItem instead of rejecting the promise returned from the read() method when the clipboard is empty, so there isn’t any impact on the async clipboard API.
Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?
None
Existing devtools support should suffice.
Yes
No
Currently emptying the clipboard is not exposed to the web, so it's not possible to add a WPT test for it.
None
None
None
False
https://bugs.chromium.org/p/chromium/issues/detail?id=1500440
https://flash-lateral-nylon.glitch.me
Shipping on desktop |
121 |
Shipping on Android |
121 |
https://chromestatus.com/feature/5192271976988672
This intent message was generated by Chrome Platform Status.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/2adf2536-daac-401a-8292-c65317d82fd3n%40chromium.org.
LGTM3
/Daniel
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw-k492DnKhWZMSSgM0E8fF-9CE1%2BoF_%3Dyhei4dC0uD9-g%40mail.gmail.com.