Consider exposing clipboard.readText to web content
Categories
(Core :: DOM: Copy & Paste and Drag & Drop, enhancement)
Tracking
()
People
(Reporter: xidorn, Assigned: mbrodesser-Igalia)
References
(Blocks 1 open bug, )
Details
(Keywords: dev-doc-needed, parity-chrome, parity-safari)
It is initially implemented in bug 1479935 but only exposed to WebExtensions. However, there is no such restriction in the spec, so supposedly it should be exposed to the web content, especially that Chrome has already been doing so.
I don't see any bug tracking that, so created one. Please dup if there is already any.
Updated•4 years ago
|
Updated•3 years ago
|
Updated•3 years ago
|
Comment 2•3 years ago
|
||
Presumably this would also make document.execCommand('paste')
work?
Safari's UI of showing an inline "Paste" contextmenu item seems like a reasonable UI approach here that keeps the user in control over the clipboard. (They only show this when the page wasn't the source of the data on the clipboard, which seems reasonable, though also gives away some information.)
(What's a bit worrying though is that the specification isn't maintained. I raised pretty serious issues with the write()
method last year that are still unaddressed. And it would have been better if these methods also worked for drag-and-drop, but I guess with Chrome and Safari shipping blocking on that is somewhat futile.)
Updated•3 years ago
|
Comment 4•2 years ago
|
||
Would it be possible to make clipboard.readText
work in paste events? I think this might help with situations like this on stackoverflow where the code isn't using the event.clipboardData
information for some reason.
Comment 5•2 years ago
|
||
What does Safari do?
Comment hidden (advocacy) |
Updated•2 years ago
|
On our app it's not possible, in a modern and secure way, to create a simple paste button. We are forced to remove this functionality for firefox users :/ Please expose it 😇
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 8•2 years ago
•
|
||
For the record: we'll add a "Paste" button for this, similar to Safari's. The rationale can be found at https://docs.google.com/document/d/1O7gHaPS7G1IuNg2yv5PXX6-T9-h6QVaWGeLwpkLlbVA/edit?usp=sharing.
Assignee | ||
Comment 9•2 years ago
|
||
The "consideration" part was resolved with c8. The actual implementation will happen in bug 1744524.
Description
•