Firefox prevents clipboard access on manually run code
Categories
(DevTools :: Console, defect, P3)
Tracking
(Not tracked)
People
(Reporter: mattia.basaglia, Unassigned)
References
(Depends on 1 open bug)
Details
Attachments
(1 file)
(deleted),
image/png
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:93.0) Gecko/20100101 Firefox/93.0
Steps to reproduce:
- Open the debug console (F12)
- type
navigator.clipboard.writeText("foo")
Actual results:
Exception "Uncaught (in promise) DOMException: Clipboard write was blocked due to lack of user activation."
Expected results:
since the code is being written directly by the user blocking the call seems pointless...
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::DOM: Core & HTML' component, and is moving the bug to that component. Please revert this change in case you think the bot is wrong.
Comment 2•3 years ago
|
||
It feels like this might be a developer tools issue. Maybe devtools needs to change how it runs the code? I'm not sure if DOM code has visibility into how the code is being invoked, so I could be wrong.
Comment 3•3 years ago
|
||
Nicolas: can you check for existing similar bugs related to features requiring user input.
Comment 4•3 years ago
|
||
It is blocked by this code:
https://searchfox.org/mozilla-central/rev/88cd13997fb0747cdcd78638fc762ff2d75e1fc5/dom/base/nsContentUtils.cpp#6892-6897
May be this code could somehow check if we are being evaluated from the console?
(I have absolutely no clue on how to do that!)
Comment 5•3 years ago
|
||
Maybe Bug 1743790 could help for that
Comment 6•2 years ago
|
||
Comment 7•2 years ago
|
||
Tested in 109.0, issue is resolved.
Updated•2 years ago
|
Description
•