Closed
Bug 1688279
Opened 5 years ago
Closed 5 years ago
Support strings as data in ClipboardItem
Categories
(Core :: DOM: Core & HTML, task, P2)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
87 Branch
| Tracking | Status | |
|---|---|---|
| firefox87 | --- | fixed |
People
(Reporter: evilpies, Assigned: evilpies)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
The initial implementation in Bug 1619947 only supports Blob. We want to supports strings as well. This reduces the required string copies when doing clipboard.writeText again.
| Assignee | ||
Comment 1•5 years ago
|
||
I have a patch that seems to work well enough. There is one open question for me about doing copying images to the clipboard via strings. This seems to always fail. I suspect this is just not possible with UTF-8? We should probably just not allow this.
Testcase:
let res = await fetch(`test.png`);
var item = new ClipboardItem({
'image/png': (await res.text())
});
await navigator.clipboard.write([item]);
| Assignee | ||
Comment 2•5 years ago
|
||
Depends on D98085
Updated•5 years ago
|
Severity: -- → N/A
Priority: -- → P2
Pushed by evilpies@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/e3b6ea92e3ff
Support strings as data in ClipboardItem r=nika
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/27404 for changes under testing/web-platform/tests
Comment 5•5 years ago
|
||
| bugherder | ||
Status: NEW → RESOLVED
Closed: 5 years ago
status-firefox87:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in
before you can comment on or make changes to this bug.
Description
•