Asynchronous Clipboard API Proposal
The primary motivation for this proposal is to address the following issues present in the current synchronous Clipboard API:
-
For security reasons, user agents may need to sanitize images before putting them on the clipboard. This can be time-consuming for large images so it is not reasonable to do it on the main thread. Thus, the current synchronous-nature of the current API prevents images from being supported in some UAs.
-
Synchronous APIs restrict the options for getting user permission before performing an action. Some permission models (like the Permissions API) require an async API.
Similar proposals have been brought up in the past. In that discussion, it was suggest that we should get browsers to implement the current API before trying to modernize it. However, due to security concerns, Chrome cannot implement parts of the current spec (e.g., supporting images). Making the API asynchronous would allow Chrome to add support for these parts.