Re: [w3c/clipboard-apis] Add `unsanitized` option to async clipboard API. (PR #197)

@snianu commented on this pull request.



> @@ -833,7 +829,7 @@ url: https://w3c.github.io/permissions/#permissions-task-source; type: dfn;
 
     1. For each |format| in |formats|["{{ClipboardUnsanitizedFormats/unsanitized}}"]:
 
-     1. If |format| is not in [=unsanitized data types=], then [=reject=] |p| with |format| {{"NotAllowedError"}} {{DOMException}} in |realm|.
+     1. If |format| is not in [=optional unsanitized data types=], then [=reject=] |p| with |format| {{"NotAllowedError"}} {{DOMException}} in |realm|.

In the Chromium's implementation we don't post the async task to read the data from the system clipboard for formats that aren't in `unsanitized` list if this check fails when `read()` is called. That makes sense as reading those formats are waste of resources if we end up throwing an exception anyway. This is why I had to move it outside the step that posts parallel tasks to do work.

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

Message ID: <w3c/clipboard-apis/pull/197/review/1735662280@github.com>

Received on Thursday, 16 November 2023 22:36:12 UTC