Is there a way to make `clipboard.writeText()` work even for "moz-extension://"(javascript on popup)?

I want to migrate this Chrome extension to Firefox-> https://github.com/lamrongol/copy_twitter.com_address .
However, on Firefox I found navigator.clipboard.writeText(text) works only on Secure contexts(https://).
I want to use clipboard.writeText() on javascript of popup of the extension, which “protocol” is “moz-extension”.