Skip to content

Add Clipboard Feature Policy #120

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Clipboard Spec: Add Feature Policy Integration
  • Loading branch information
Darwin Huang committed Jun 13, 2020
commit 17ac8909319b57cde46b731745ebff7c20ea862b
25 changes: 21 additions & 4 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;

1. Let |r| be the result of running [=check clipboard read permission=] [=in parallel=]

1. If |r| is not "granted", then reject |p| with a "NotAllowedError" DOMException
1. Let |f| be the result of checking clipboard feature policy [=in parallel=]

1. If |r| is not "granted", or |f| is not "granted", then reject |p| with a "NotAllowedError" DOMException

1. Let |data| be a copy of the [=system clipboard data=] represented as
a sequence of {{ClipboardItem}}s.
Expand Down Expand Up @@ -659,7 +661,9 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;

1. Let |r| be the result of running [=check clipboard read permission=] [=in parallel=]

1. If |r| is not "granted", then reject |p| with a "NotAllowedError" DOMException
1. Let |f| be the result of checking clipboard feature policy [=in parallel=]

1. If |r| is not "granted", or |f| is not "granted", then reject |p| with a "NotAllowedError" DOMException

1. Let |data| be a copy of the [=system clipboard data=].

Expand Down Expand Up @@ -693,7 +697,9 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;

1. Let |r| be the result of running [=check clipboard write permission=] [=in parallel=]

1. If |r| is not "granted", then reject |p| with a "NotAllowedError" DOMException
1. Let |f| be the result of checking clipboard feature policy [=in parallel=]

1. If |r| is not "granted", or |f| is not "granted", then reject |p| with a "NotAllowedError" DOMException

1. Let |cleanItemList| be an empty sequence<{{Blob}}>.

Expand Down Expand Up @@ -734,7 +740,9 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;

1. Let |r| be the result of running [=check clipboard write permission=] [=in parallel=]

1. If |r| is not "granted", then reject |p| with a "NotAllowedError" DOMException
1. Let |f| be the result of checking clipboard feature policy [=in parallel=]

1. If |r| is not "granted", or |f| is not "granted", then reject |p| with a "NotAllowedError" DOMException

1. Let |newItemList| be an empty sequence<{{ClipboardItem}}>.

Expand Down Expand Up @@ -1080,6 +1088,15 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn;

</div><!-- algorithm -->

<h2 id="feature-policy-integration">Feature Policy Integration</h2>

This specification defines two [=policy-controlled feature=]s identified by the
strings <code>"clipboard-read"</code> and <code>"clipboard-write"</code>, which
correspond to the permissions of the same name. <code>"clipboard-read"</code>
restricts {{Clipboard/read()}} and {{Clipboard/readText()}}, and
<code>"clipboard-write"</code> restricts {{Clipboard/write()}} and
{{Clipboard/writeText()}}. Both have a [=default allowlist=] of
<code>["self"]</code>.

<h2 id="security">Security Considerations</h2>

Expand Down