On Wed, Nov 3, 2021 at 7:13 PM Anupam Snigdha <snianu.micros...@gmail.com>
wrote:

> This is a good scenario, but I'm not sure if this can be solved using the
> current design. You probably want a promise to the ClipboardItem? Also, I
> think the MIME type in the Clipboarditem is only useful when we are
> specifying DOMString instead of Blobs, which is currently not supported in
> Chromium. If we create a Blob after the data has been populated, then we
> can probably just use the MIME type from the Blob during the clipboard
> write operation. This feature can be implemented just like the promises to
> blobs without breaking the sites that use ClipboardItem instead of promises
> to ClipboardItem, so we should definitely consider adding this to the async
> clipboard API in the future.
> The promises to Blobs feature unblocks some of the key scenarios in Excel
> online as well as scenarios where a promise to the Blob helps in creating
> the Blob asynchronously without losing the transient user activation delay,
> so I think this feature will still be useful even if we implement promise
> to ClipboardItem.
>

Taking one step back, in my ideal world, Safari would just let me do the
following without expiring the user gesture:

    // Works in Chromium, throws in Safari…
    const { data, type } = await getDataOfUnknownType();
    const blob = new Blob([data], { type });
    navigator.clipboard.write([
      new ClipboardItem({
        [blob.type]: blob,
      }),
    ]);

-- 
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+unsubscr...@chromium.org.
To view this discussion on the web visit 
https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CALgRrLkvjKBj0bqYd2Gj6kHmN6%3DuhkFTnDX-49HseX1f_xd9WA%40mail.gmail.com.

Reply via email to