I've developed a Firefox Addon which has a feature of copying some text automatically when the popup window is open. This works fine on Chrome, but it doesn't work in Firefox, and gives me this error message.
uncaught (in promise) DOMException: clipboard write was blocked due to lack of user activation.
I use the clipboard API to do this.
navigator.clipboard.writeText(data).then(()=>{
console.log('copied')
})
Any thoughts to bypass this or fix this?