← Back to release summary

Add support for Promise to Blobs in clipboard item

Category
Miscellaneous
Type
Chromium catches up
Status
Enabled by default (Chrome 98)
Intent stage
Shipped

Summary

Add promise support to `ClipboardItem` object. This helps the web author to call async clipboard write method without having to provide the Blob data synchronously. Authors can choose to resolve the promise later when the Blob data is available.

Motivation

When async clipboard.write API is called, web developers would want to provide a promise to a Blob type instead of synchronously populating the Blob data while writing it to the clipboard. This helps in performance and gives the web authors the flexibility to call write method(satisfying the requirements of calling clipboard write API) without blocking on populating the Blob data that is part of the ClipboardItem.

Standards & signals

Explainers: https://www.w3.org/TR/clipboard-apis/#typedefdef-clipboarditemdata

View on chromestatus.com