[w3c/clipboard-apis] Report unsupported data types that were on the clipboard? (#129)

As browsers roll out implementation, websites will find themselves in a situation where they may want the user to paste certain data types (e.g. a specific image format). At the moment, there is no way to distinguish the following:

- The browser doesn't support the format for reading.
- The clipboard didn't contain the format.

If we provide an API for the website to check if a read type is supported, this would allow them to distinguish. However, we could make it easier for sites to detect this situation and/or provide error messages if they can tell whether there was a format on the clipboard that was not available to paste. ("It seems you tried to paste JPEG, but your browser only supports PNG right now.")

If reporting on arbitrary formats is not a great idea, then it could be restricted to [the formats in the API](https://www.w3.org/TR/clipboard-apis/#reading-from-clipboard).

I don't actually think this is a great idea, but I thought I'd file it as an alternative to #67.

-- 
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/129

Received on Friday, 26 June 2020 23:18:08 UTC