Closed Bug 1616077 Opened 5 years ago Closed 5 years ago

Permission inconsistency between ctrl+c and right click copy (copy event, clipboard writeText)

Categories

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

73 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1597857

People

(Reporter: neil-mozilla, Unassigned)

Details

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0

Steps to reproduce:

When listening for the copy event, if it is triggered by right click -> copy, permission is denied when trying to writeText() to the clipboard.

It works as expected when triggered by control + c

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:73.0) Gecko/20100101 Firefox/73.0

<code>
document.addEventListener('copy', (event) => {
var copyData = 'some test data';
navigator.clipboard.writeText(copyData).then(function() {
// control + c works as expected
console.log('writeText() Success');
}, function() {
// right click -> copy gets rejected
console.log('writeText() Failed');
});
});
</code>

I have created a jsfiddle to demonstrate the issue here: https://jsfiddle.net/y5vjeud4/

Actual results:

clipboard.writeText() permission is denied when copy event is triggered by right click -> copy

Expected results:

clipboard.writeText() should be granted permission when triggered by either control +c or right click -> copy

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

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

annyG, is this just a bug, or is there more subtle intent here?

Flags: needinfo?(agakhokidze)
Priority: -- → P3

This should be fixed by bug 1597857. It works for me in 74.

Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Flags: needinfo?(agakhokidze)
You need to log in before you can comment on or make changes to this bug.