Permission inconsistency between ctrl+c and right click copy (copy event, clipboard writeText)
Categories
(Core :: DOM: Events, defect, P3)
Tracking
()
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
Comment 1•5 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
annyG, is this just a bug, or is there more subtle intent here?
Comment 3•5 years ago
|
||
This should be fixed by bug 1597857. It works for me in 74.
Updated•4 years ago
|
Description
•