Closed Bug 1942709 Opened 19 days ago Closed 12 days ago

Allow webconsole to execute features gated by user activation

Categories

(DevTools :: Console, enhancement)

Firefox 134
enhancement

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1283341

People

(Reporter: Susko3, Unassigned)

References

()

Details

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

Steps to reproduce:

  1. Go to a website (e.g. https://example.com)
  2. Open browser console (F12)
  3. Type navigator.clipboard.writeText("test")
  4. Press enter

Actual results:

Uncaught (in promise) DOMException: Clipboard write was blocked due to lack of user activation.

Expected results:

The text "test" should be written to the clipboard. Since I'm explicitly entering the command and pressing enter, this should be considered user activation.

The Bugbug bot thinks this bug should belong to the 'DevTools::Console' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Console
Product: Firefox → DevTools

Could be interesting as an enhancement as long as it's not confusing for users. They shouldn't be lead to believe that such code would work without activation in the actual page.

Nicolas, did you hear about similar requests to open APIs requiring user activation when coming from the console?

https://developer.mozilla.org/en-US/docs/Web/Security/User_activation

Status: UNCONFIRMED → NEW
Type: defect → enhancement
Ever confirmed: true
Flags: needinfo?(nchevobbe)
Summary: navigator.clipboard.writeText() is denied when running it from the browser console → Allow webconsole to execute features gated by user activation

This looks similar to Bug 1283341, I guess we can duplicate this bug?

Flags: needinfo?(nchevobbe)

Sounds similar yes.

Status: NEW → RESOLVED
Closed: 12 days ago
Duplicate of bug: 1283341
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.