Closed Bug 1616388 Opened 4 years ago Closed 3 years ago

[Clipboard API] Support PNG images in async clipboard API


(Core :: DOM: Events, enhancement, P3)

74 Branch



Tracking Status
firefox-esr68 --- wontfix
firefox73 --- wontfix
firefox74 --- wontfix
firefox75 --- wontfix


(Reporter: adel.mehrban, Unassigned)


(Blocks 1 open bug)


User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/82.0.4056.3 Safari/537.36

Steps to reproduce:

Trying to copy an image into the clipboard using Clipboard API navigator.clipboard.write method

Demo here:

Actual results:

ReferenceError: ClipboardItem is not defined

Expected results:

Image data to be copied into clipboard

Using the provided demo, I have reproduced this issue on Windows 10 and Ubuntu 18, on all the latest versions of the main channels.
Thank you for your contribution!

Ever confirmed: true
OS: Unspecified → All
Hardware: Unspecified → Desktop

I am not sure whether this component is correct. If incorrect, please set a more appropriate one. Thank you!

Component: Untriaged → DOM: Selection
Product: Firefox → Core

These are behind a pref ( and disabled by default.

annyG, do we already have a bug tracking turning these on by default? I didn't find one.

Flags: needinfo?(agakhokidze)

Turning that flag on didn’t have any effect BTW

In one of my bugs ( I mentioned that we don't support non-text data for read and write APIs even with the pref turned on. I am a little bit fuzzy on the exact reason, but I believe at the time when I was working on this, Chrome did not support non-text read/write APIs either and we wanted to hold off until the clipboard specification became final. I am now seeing that Chrome 76 added support for copy/pasting PNG images. Currently, we don't have a bug tracking turning on by default, nor for adding non-text data support.

Flags: needinfo?(agakhokidze)
Component: DOM: Selection → DOM: Events
Priority: -- → P3
Summary: [Clipboard API] copy data not working → [Clipboard API] Support PNG images in async clipboard API

Is there any reason the only option is going to be PNG like Chrome? Why not go above that and add for example jpg as well?

Blocks: 1619251
Severity: normal → S3
Type: defect → enhancement

This very same issue caused by ReferenceError: ClipboardItem is not defined also appears on MacOS FF version 83.0 (64-bit) and 84.0b4 (64-bit).

IMO that is clearly a defect, not an enhancement.

My implementation in bug 1619947 actually has code to copy images to the clipboard. However the code is still a draft.

Closed: 3 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.