Re: Clipboard API: remove dangerous formats from mandatory data types

On Tue, Jun 9, 2015 at 8:39 PM, Daniel Cheng <dcheng@google.com> wrote:

> Currently, the Clipboard API [1] mandates support for a number of formats.
> Unfortunately, we do not believe it is possible to safely support writing a
> number of formats to the clipboard:
> - image/png
> - image/jpg, image/jpeg
> - image/gif
>

Hi Daniel,
I've been pondering this a bit and I think a first step is to split the
list of "mandatory data types" into two: one list for types you must
support reading from the clipboard, and one (smaller) for types you must
support writing to the clipboard. So PNG, JPG et al go in the "support
reading from clipboard" list, and the "support writing" starts out with
text/plain, text/html and text/uri-list - although it would be nice if CSV
was also considered safe enough.

It would also be good if we could come up with an API for safely writing
images to the clipboard. Just playing:
event.clipboardData.addImageFromCanvas(canvasElm, 'image/png')

Hot or not?

-Hallvord R.

Received on Monday, 27 July 2015 19:04:08 UTC