title: Copy text to clipboard from background script in a Firefox WebExtension
body: <p>I am porting my Chrome extension over to Firefox. It has a paste to clipboard function. But, I have not yet had any luck with doing that in Firefox. Here is what I am trying to do in my background script:</p>
  
  <pre class="lang-js prettyprint-override"><code>const input = document.createElement('textarea');
  input.style.position = 'fixed';
  input.style.opacity = 0;
  input.value = text;
  document.body.appendChild(input);
  input.select();
  document.execCommand('copy');
  logger(text);
  document.body.removeChild(input);
  </code></pre>
  
  <p>This works fine in Chrome. I have the <code>clipboardWrite</code> permission in my manifest. Any hints why it is not working with Firefox?</p>