Consider modifying nsIClipboardDataSnapshot.getData{Sync}() to support retrieving data for multiple types at once
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, enhancement)
Tracking
()
People
(Reporter: edgar, Assigned: edgar)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Currently, nsIClipboardDataSnapshot.getData{Sync}() retrieves only the first available type of nsITransferable and throws an error if nsITransferable contains a type not in the flavor list. This behavior is primarily due to how each platform implements GetNativeClipboardData(). So when we would like to get data for multiple types, we would need to create a temporary nsITransferable contains only one type for each type that we want to load, e.g. https://searchfox.org/mozilla-central/rev/3b3c7a0c930a5451be3b4088ed795ce01ddf002e/editor/libeditor/EditorBase.cpp#7368-7402.
I think we could try to make nsIClipboardDataSnapshot.getData{Sync}() more flexible to use to support load all available type in nsITransferable and ignore the type if it doesn't in the available flavor list (instead of throwing an error).
After bug 1951225, {Async}GetNativeClipboardData() is more flexible to use, which makes the implementation easier.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 1•1 year ago
|
||
| Assignee | ||
Comment 2•1 year ago
|
||
After bug 1951225, {Async}GetNativeClipboardData() became more flexible to use.
We can now have nsIClipboardDataSnapshot.getData{Sync}() load all available types
without accidentally including types not in the flavor list.
Description
•