From 31b8d49ed537fa3a95dcd7c7945559960cd478b8 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Tue, 11 Aug 2020 05:21:00 +0200 Subject: [PATCH] Remove clipboard-read permission --- index.bs | 55 ++++--------------------------------------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/index.bs b/index.bs index 868da61..685d432 100644 --- a/index.bs +++ b/index.bs @@ -935,8 +935,7 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn; powerful features like the clipboard. It allows websites to request permissions from users and query which permissions they have. - For the clipboard, two separate permissions are defined: - "clipboard-read" and + For the clipboard, one permission is defined: "clipboard-write" Note: Clipboard permissions currently only apply to the Async Clipboard API. @@ -960,87 +959,41 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn; There are 4 clipboard permissions: - * { name: "clipboard-read", allowWithoutGesture: false } - * { name: "clipboard-read", allowWithoutGesture: true } * { name: "clipboard-write", allowWithoutGesture: false } * { name: "clipboard-write", allowWithoutGesture: true } With the following relationships: - * { "clipboard-read" + true } is stronger than { "clipboard-read" + false } * { "clipboard-write" + true } is stronger than { "clipboard-write" + false } - Note: "clipboard-read" and "clipboard-write" are two separate permissions with no - inherent strength relationship. However, user agents MAY choose to impose such a - strength ordering on these permissions, for example by making the "clipboard-read" - permission act stronger than the "clipboard-write" permission. Doing this would - effectively turn the "clipboad-read" permission into a way to provide full - read/write access to the clipboard since granting (or denying) "clipboard-read" would - also grant (deny) "clipboard-write" access. - While user agents MUST support the {{ClipboardPermissionDescriptor}} as described in this specification, they, of course, retain complete control over the default settings and how (or if) they are exposed to the user.
- A user agent that wants to have separate user-settable read and write controls over the clipboad + A user agent that wants to have separate user-settable write controls over the clipboard and always require a user gesture would handle each descriptor as follows: - * { "clipboard-read" + false } is exposed for user control - * { "clipboard-read" + true } is always denied * { "clipboard-write" + false } is exposed for user control * { "clipboard-write" + true } is always denied
-
- A user agent that wants to automatically grant "write" access (with a gesture), - but have a single user-settable permission that controls full gesture-less access would - define "clipboard-read" as being stronger than "clipboard-write" and then handle - each descriptor as follows: - - * { "clipboard-read" + false } is inherited from - { "clipboard-read" + true } - * { "clipboard-read" + true } is exposed for user control - * { "clipboard-write" + false } is inherited from - { "clipboard-write" + true } - * { "clipboard-write" + true } is granted by default, but - may be overridden by { "clipboard-read" + true } because - "read" is stronger than "write". -
-

Clipboard read permission

check clipboard read permission

- 1. Let |readWithoutGesture| be the [=permission state=] of the - { name: "clipboard-read", allowWithoutGesture: true } - permission. - - 1. If |readWithoutGesture| is granted, then return true. - 1. Let |hasGesture| be true if the [=relevant global object=] of [=this=] has [=transient activation=], false otherwise. 1. If |hasGesture| then, - 1. Let |systemPaste| be true if the current script is running as a result of user + 1. Return true if the current script is running as a result of user interaction with a "Paste" element created by the user agent or operating system. - 1. If |systemPaste| is true, then return true. - - 1. Return the result of [=request permission to use=] the - { name: "clipboard-read", allowWithoutGesture: false } - permission. - - Note: User agents may choose to request a stronger permission that - will implicitly update this permission. - - 1. Return the result of [=request permission to use=] the - { name: "clipboard-read", allowWithoutGesture: true } - permission. + 1. Return false.