title: Copy text to clipboard from bookmarklet
body: <p>I'm trying to write a little bookmarklet that can extract some text from the active page and load that into the clipboard.</p>
  
  <p>The extraction is easy enough, but I'm really stuck doing the clipboard-copying part. Currently, I'm just <code>alert</code>ing the text and hitting <kbd>Ctrl</kbd>+<kbd>C</kbd> to copy the text from the message-box, which isn't ideal.</p>
  
  <p>I've read <a href="https://stackoverflow.com/questions/400212/how-to-copy-to-clipboard-in-javascript">How to Copy to Clipboard in JavaScript</a> and other questions that suggest I use <a href="http://code.google.com/p/zeroclipboard/" rel="noreferrer">zeroclipboard</a>, but I have no idea how one would make that work from a <em>bookmarklet</em>, considering I have to load <em>external</em> flash and javascript resources to be able to use the library. </p>
  
  <p>I have no issues with messing up the page's DOM to accomplish this or having to enable some permissions on my browser (Google Chrome), considering this is just a private bookmarklet.</p>
  
  <p>Any pointers would be appreciated.  </p>