[w3c/clipboard-apis] Adding image into a clipboard (#80)

I am a developer of www.Photopea.com . It is an in-browser image editor used by thousands of people every day. Copy-pasting images between Photopea and other programs (usually still within a browser) is a crucial thing for us. 

We listen to "paste" event on "window", then we loop through Event.clipboardData.items and call getAsString() / getAsFile() on each item.

We need to copy-paste things within Photopea, but writing images to a "system" clipboard is not possible at the moment, so we have to implement our local clipboard for Photopea (which contains data copied within Photopea).

When the user presses Ctrl+V, we detect both "paste" event, and the keyboard shortcut combination. But it is not clear, whether we should paste the content of a local clipboard, or the system clipboard. The solution would be to paste the "most recent" content (i.e. depending on the time of creation of the clipboard content), but the current API does not give us the creation time of the system clipboard content.

There would not be any such problem, if we could simply write images to the system clipboard, instead of creating a local one. Can you make sure it is possible in the current API, or at least expose the creation time of clipboard data?

When a user creates a new image in a native image editor, the Width and Height fields are pre-set according to the dimension of a system clipboard image (if there is any). This can not be done in the web. Could you also make sure, that apps can access the clipboard content without a user pressing Ctrl+V?

There are about 10 people every week writing me to implement / fix these things, so I am really desperate and don't know what to do :(

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/clipboard-apis/issues/80

Received on Saturday, 16 June 2018 19:33:54 UTC