Open BoCupp-Microsoft opened 2 years ago
@mbrodesser @annevk
I see where the ClipboardItem.prototype.types
question in the other issue comes from now, I think. It would make sense to me if that lists all the types (lexicographically sorted) that the ClipboardItem
contains. Otherwise you don't know what you can getType()
.
@annevk Agreed that ClipboardItem.prototype.types
should list all the types(both custom & well known formas), but not sure about sorting lexicographically as there are platform specific requirements where the most desired format should be listed at the top. In this case, it would be custom formats at the top, well-known formats come after.
If platforms have a deterministic sorting order for built-in formats that works too, but presumably we need to say something for custom formats?
Mostly authors are only interested in reading representations from the clipboard that they know how to ingest into their app. For building a clipboard examiner app like this, however, you don't know what types you need to request until after you read.
Since the current proposal requires the author to explicitly list every custom mime-type before they call read, it seems like a the clipboard examiner app won't be able to show everything that could possibly be requested from the clipboard with the current proposal.
There was an alternative considered for
unsanitized:true
in the explainer that said it would cause all representations to be read unsanitized. That could solve the problem, but it would prevent the author from simultaneously requesting a sanitized copy of the well-known representations if they that's what they wanted.Another option may be to move the unsanitized option to the
ClipboardItem.getType
call instead of theClipboard.read
.@snianu