Re: Clipboard API: Proposal for asynchronous API

Hi Gary,
good work! Some questions that have come up in discussion with
developers at Mozilla:

1) The existing DataTransfer API is purposefully designed to be used
for both copy/paste and drag-and-drop. If we add navigator.clipboard
to add asyncness to clipboard-style usage of the API, what about DnD?

2) If there are several large chunks of data on the clipboard, the
current navigator.clipboard proposal will probably still mean
shuffling lots of data around - if all those chunks need to be
processed before the promise callback. Have we considered a model
where DataTransfer itself is promise-ified? Something like
clipboardData.items[0].getAsPromise().then( ... )?

On Tue, May 17, 2016 at 12:17 AM, Gary Kačmarčík (Кошмарчик)
<garykac@google.com> wrote:
> I just sent a proposal to the WICG for an asynchronous Clipboard API:
> https://discourse.wicg.io/t/proposal-modern-asynchronous-clipboard-api/1513
>
> (yes, I know. Not the first time something like this has been proposed)
>
> This is a follow-up to an earlier thread
> Clipboard API: remove dangerous formats from mandatory data types
> where Chrome is unable to safely add clipboard support for a number of image
> formats.
>
> An async API would allow these image formats to be supported (because the
> sanitization could happen without blocking the main thread).
>

Received on Thursday, 26 May 2016 08:02:03 UTC