Skip to content
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 consideration for not allowing this before the first read #6

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zgroza
Copy link
Collaborator

@zgroza zgroza commented Feb 17, 2025

No description provided.

Comment on lines +175 to +177
- The returned promise should be rejected before the document first successfully calls `read()` or `readText()` within a
session. In particular, a browser that implements persistent clipboard permissions might just put this behind
`clipboard-read`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just putting this behind clipboard-read isn't equivalent to rejecting before the document first calls read(), since that permission could be remembered from a different visit. You can probably just remove the second sentence, unless there's a use case I'm not seeing for getting the content-id before reading within a given visit?

Suggested change
- The returned promise should be rejected before the document first successfully calls `read()` or `readText()` within a
session. In particular, a browser that implements persistent clipboard permissions might just put this behind
`clipboard-read`.
- The returned promise should be rejected before the document first successfully calls `read()` or `readText()` within a
session.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, this isn't equivalent, yes - but the entire idea is to forbid applications that have no business using clipboard from using this. If a site has full access to the clipboard anyway because of the persistent permission, it would make sense not to bar it from using this API.

Co-authored-by: Jeffrey Yasskin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants