Add Clipboard Feature Policy#120
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.
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.
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.
|
|
||
| 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.
Same as above... immediately return the rejected promise, otherwise continue in parallel.
|
|
||
| 1. Let |p| be a new [=Promise=]. | ||
|
|
||
| 1. If the [=current settings object's=] responsible document is not |
|
|
||
| 1. Let |p| be a new [=Promise=]. | ||
|
|
||
| 1. If the [=current settings object's=] responsible document is not |
marcoscaceres
left a comment
There was a problem hiding this comment.
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