I need help copying rich text to the clipboard using JavaScript. I have searched around and haven\'t found anything to suit my specific needs.
The Document.execCommand() is apparently becoming obsolete:
Ref: https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand),
There is a new Clipboard API:
https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API
There are some examples here https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with_the_clipboard
And also here: https://web.dev/async-clipboard/