Re: [w3c/clipboard-apis] Read Blob data for the supported formats on-demand during getType. (Issue #191)

A couple thoughts

1. It doesn't _seem_ like the API was designing with this concern in mind (in fact, the spec is explicit about it not working this way). If the API were designed to handle this, I would have expected the list of preferred formats to have been passed as a parameter in the read function. We could still introduce a version of read that works that way (returning only the first format in the list which exists on the clipboard). This avoids the problem of mismatched sequence numbers altogether.
2. In lieu of that, being able to specify lazy loading as an option similar to #197 allows site to control this behavior. (It seems entirely reasonable for a site to exist that stores the returned `clipboardItem`s and calls `getType()` at a later time, perhaps for example to provide "clipboard history" functionality. This site would now be broken.) It's not clear to me what the default value should be. The least likely to cause problems for existing sites is for the default to match the current behavior (not lazy loading); the most likely to be beneficial for performance overall is to make lazy loading the default.

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

Message ID: <w3c/clipboard-apis/issues/191/1817228770@github.com>

Received on Friday, 17 November 2023 23:02:57 UTC