Re: [w3c/clipboard-apis] Arbitrary clipboard types (Issue #165)

I am very existed about this proposal! We are building an XML editor in which we would love to have a way to initiate a `paste` from a user interaction. Because we are working with XML, we have the need to input a non-standard mimetype to the clipboard: `application/xml`. We have everything working in Chrome 104: write and read to the `web application/xml` mimetype.

Our context: we write `text/plain`, `text/html`, `application/xml` and `application/json` to the clipboard. The first two for interoperability with other applications, the last two for our editor specifically. 

Ideally, we want to use the async clipboard IFF there is custom mimetype support and instruct using the shortkeys in all other cases.

We are however stuck at how we should _detect the support of arbitrary mimetypes for the clipboard_. Specifically the case where the async clipboard API is available but custom mimetypes are not. IE, Chrome version 103 and earlier. If Firefox would take the same process as Chrome (allow the normal mimetypes before the arbitrary ones), we are unable to detect this.

With the current APIs we have a difficult time detecting whether something is pasted from an external source (`text/plain` and `text/html` are present) versus pasting from our editor, but w/o arbirtary mimetype support (only `text/plain` and `text/html` would be available).

Am I overlooking something or is this case indeed very tricky to detect?



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

Message ID: <w3c/clipboard-apis/issues/165/1197976360@github.com>

Received on Thursday, 28 July 2022 10:44:02 UTC