I execute the following code
document.evaluate("/html/body/div/section/div/div/div[2]/div/div/button", document.body, null, 9, null). singleNodeValue.click();
on a "special" web page, moz-extension://653e6c0d-1f66-4b94-bc7c-78b55048de66/dashboard/html/browser.html
This click should insert something on the clipboard but instead, I get this error message:
UNHANDLED PROMISE REJECTION: NotAllowedError: Clipboard write was blocked due to lack of user activation.
I have read How to copy to clipboard on Firefox addon popup script? which discusses the same error message, but that situation is different from mine.
What do I need to do to insert something on the clipboard this way?