-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add Clipboard Feature Policy #120
base: main
Are you sure you want to change the base?
Conversation
again, it's kinda annoying that we ended up with "clipboard-read" and "clipboard-write" as the feature name :( ... would have been nice to have a single name, as we are again potentially setting a bad precedence. |
Thanks for the review! I've updated the change a bit now per the comments. Yeah, I agree that a single feature name would have been nice as well, but am just trying to match the clipboard spec's permission names with the feature policy, as feature policy and permissions are merging since this change. |
Filed bug on the Gecko side too. |
1. Let |p| be a new [=Promise=]. | ||
|
||
1. If the [=current settings object's=] responsible document is not | ||
[=allowed to use=] the "clipboard-write" feature, then reject |p| | ||
with a "NotAllowedError" DOMException. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This current algorithm currently continues with the rejected promise, instead of returning it. Let's do:
1. Let |p| be a new [=Promise=]. | |
1. If the [=current settings object's=] responsible document is not | |
[=allowed to use=] the "clipboard-write" feature, then reject |p| | |
with a "NotAllowedError" DOMException. | |
1. If the [=current settings object's=] responsible document is not | |
[=allowed to use=] the "clipboard-write" feature, then | |
return a promise rejected with a "NotAllowedError" DOMException. | |
1. Let |p| be a new [=Promise=]. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some nits... I think you can link [=responsible document=] and [=a promise rejected with=] ... please confirm by looking up the terms at https://respec.org/xref/ ... you can probably link {{DOMException}} too.
@@ -655,11 +659,15 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn; | |||
|
|||
1. Let |p| be a new [=Promise=]. | |||
|
|||
1. If the [=current settings object's=] responsible document is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above... immediately return the rejected promise, otherwise continue in parallel.
@@ -689,11 +697,15 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn; | |||
|
|||
1. Let |p| be a new [=Promise=]. | |||
|
|||
1. If the [=current settings object's=] responsible document is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above here too...
@@ -730,11 +742,15 @@ urlPrefix: https://w3c.github.io/FileAPI/#dfn-; type: dfn; | |||
|
|||
1. Let |p| be a new [=Promise=]. | |||
|
|||
1. If the [=current settings object's=] responsible document is not |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same... 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Super close... what might be interesting now is to rebase this given the transient activation text is in the spec... we might be able to also do the transient activation checks early.
Are we too late to rename them? It seems currently Chrome has the only implementation, should we discuss about renaming? (I think I saw somewhere that WebKit has no intent to implement them. Edit: Yes, #101 (comment)) |
Yes, if only Firefox and Chrome are supporting these, we should discuss renaming them... but we would need to commit to implementing them too. |
Firefox has no implementation, only Chrome does. |
Understood, but we should figure out if we will implement it in the future (and figure out if what's in the spec is palatable to us, and remove what Gecko is not willing to support to match reality). |
What is really annoying is that browsers have gone ahead with their own implementation for a critical feature. This ends up forcing developers to use commands to read and write to the clipboard to work around this nonsense. |
Closes #106
The following tasks have been completed:
Implementation commitment:
Preview | Diff