You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ClipboardAPI/SelectiveClipboardFormatRead/explainer.md
+15-7Lines changed: 15 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ We propose API signature changes to the [clipboard.read()](https://www.w3.org/TR
72
72
73
73
We propose to rename the optional argument [`ClipboardUnsanitizedFormats`](https://www.w3.org/TR/clipboard-apis/#dictdef-clipboardunsanitizedformats) of [read()](https://www.w3.org/TR/clipboard-apis/#dom-clipboard-read) API to [`ClipboardReadOptions`](#appendix-1-proposed-idl) and extend this object to include a new `types` property which is a list of mime types to be retrieved.
74
74
75
-
Existing implementations and web applications that use [navigator.clipboard.read()](https://www.w3.org/TR/clipboard-apis/#dom-clipboard-read)without specifying types or with empty MIME types will continue to behave as before, receiving all available clipboard formats.
75
+
Existing implementations and web applications that use [navigator.clipboard.read()](https://www.w3.org/TR/clipboard-apis/#dom-clipboard-read) will continue to behave as before when `types` is `undefined`, receiving all available clipboard formats.
76
76
77
77
If a MIME type is provided in [`unsanitized`](https://www.w3.org/TR/clipboard-apis/#dom-clipboardunsanitizedformats-unsanitized) but not requested in `types`, the clipboard content for the provided type will not be read from the OS clipboard and hence will be unavailable in the clipboard read response.
constavailableTypes=item.types; // ['text/plain', 'text/html']. Note all available types are present.
120
+
constitem2= items2[0];
121
+
constavailableTypes2=item2.types; // []
116
122
```
117
123
118
124
Please refer [Appendix 1](#appendix-1-proposed-idl) for the proposed IDL.
@@ -215,7 +221,9 @@ For developers interested in reproducing these results or running similar benchm
215
221
To use live demo, open [this](https://ashishkum-ms.github.io/cr-contributions/sfr/performace_experiment.html) in a browser that supports the Selective Clipboard Format Read.
0 commit comments