Re: [w3c/clipboard-apis] Feature detection for supported clipboard formats (Issue #170)

The Web Editing Working Group just discussed `feature detection for clipboard`.

<details><summary>The full IRC log of that discussion</summary>
&lt;Travis> Topic: feature detection for clipboard<br>
&lt;Travis> github: https://github.com/w3c/clipboard-apis/issues/170<br>
&lt;Travis> snianu: Didn't have time to discuss internally; but authors should have an ability to get the available formats on the clipboard.<br>
&lt;Travis> .. not really sure if this is should be a new API or not.<br>
&lt;Travis> .. if the proposal sounds good to everyone then we don't have any objections.<br>
&lt;Travis> johanneswilm: Will MS be able to take this up next month?<br>
&lt;Travis> annevk: I was wondering what happens if you create a clipboard item for an unsupported format and try to write it?<br>
&lt;Travis> snianu: chromium throws today.<br>
&lt;Travis> annevk: Is that an OK single to know it isn't supported?<br>
&lt;Travis> whsieh: I think that's right... If the author tries to write and it throws an exception...<br>
&lt;Travis> .. Trying types until it doesn't throw is the current approach.<br>
&lt;Travis> Travis: maybe that's good enough, barring any other customer signal?<br>
&lt;Travis> johanneswilm: Scenario: say I have a format that takes a lot of time to prepare for a test (say WebP conversion before clipboard test)<br>
&lt;Travis> .. if that's the case, then I understand why authors would like to know before doing all that work.<br>
&lt;Travis> .. did I understand that correctly?<br>
&lt;Travis> Anupam: in chromium, that's the way it is.<br>
&lt;whsieh> those three are image/png, text/plain, and text/html I believe?<br>
&lt;Travis> .. there are some "manditory" formats that everyone supports.<br>
&lt;Travis> .. There are open questions about how some custom formats could become mandatory formats.<br>
&lt;Travis> .. suppose we could check for the prefix?<br>
&lt;Travis> johanneswilm: Scenario: I create a JS-based image format, then browsers change what they support. When I export to the clipboard I will need to keep a list of what browsers support and export as needed.<br>
&lt;Travis> .. I might first try one that is accepted, then try again if it throws.<br>
&lt;Travis> annevk: As I wrote... I think this does need addressing.<br>
&lt;Travis> .. if you wanted to write multiple at a time, you won't know which one wasn't supported.<br>
&lt;Travis> .. I think there is a real need for something like this.<br>
&lt;Travis> .. alternative is all browsers support the same formats.<br>
&lt;Travis> whsieh: I think there is compelling need if some browsers will support new formats that others won't... but in the current climate, this isn't very pressing.<br>
&lt;Travis> .. Do agree, we should investigate this.<br>
&lt;Travis> .. This is just about writing to the clipboard. The term "supports" is a little vague... would like to see a name more accurately reflecting that it's about writing.<br>
&lt;Travis> .. I will bring it up with my peers.<br>
&lt;Travis> johanneswilm: So we will want to hear from both Microsoft and Apple next meeting.<br>
&lt;Travis> Annevk: on the name, I think "supports" is probably OK. Seems like the most prominent thing and there is precident.<br>
&lt;Travis> .. I think it's OK from that perspective.<br>
</details>


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

Message ID: <w3c/clipboard-apis/issues/170/1064240391@github.com>

Received on Thursday, 10 March 2022 16:19:40 UTC