Proposal: Privileged navigator.clipboard for content scripts #378
Labels
enhancement
Enhancement or change to an existing feature
follow-up: chrome
Needs a response from a Chrome representative
Preamble
References > Web APIs > Clipboard
Understandable for a website using the Web API
Mozilla > Add-ons > Browser Extensions > Interact with the clipboard
The API access should differentiate between a webpage and an extensions with the necessary permissions.
There are already some differences implemented between the webpage context and content context in Firefox e.g.
Consequence
The status quo provides no additional security in extensions with the necessary permissions. All it does. is creating extra unnecessary processes (for the extension & the browser) to send the data back (and forth) to the background script to perform the exact same function.
Furthermore, it increases the reliance on background script processing where a reduction is desired (especially for MV3).
Proposal
In a content script with the necessary permissions ,
navigator.clipboard
should be able to function on all pages supported for content scripts (e.g. http/https/file/about:blank).Footnote
Testing
navigator.clipboard.writeText()
on FirefoxContent Script
https
|file
http
|about:blank
UserScript
UserScript context is mentioned for reference to #279 (
USER_SCRIPT
Execution World)http
|https
|file
|about:blank
DOMException: Clipboard write was blocked due to lack of user activation.
The text was updated successfully, but these errors were encountered: