Screengrab! can now copy a document to the clipboard instead of saving it.

This is one of those things that people asked for, so they got it.

How?
Select “Copy” from the menu instead of “Save”. It should really be self-explanatory.

A bit of background
This only works if you are using Canvas to do your grabs. Java has the capability (and I’ve recently figured out how to make the Java based code use the clipboard - I think) but it isn’t implemented yet.

To be honest, this was a lot harder than it sounds on paper. A LOT harder. In the end I didn’t REALLY figure it out at all. The implementation is a hack, but it’s a necessary hack to get around the complete lack of useful documentation in this area.

The ideal way to implement this feature would be to access the clipboard, set the appropriate data flavours and add the image data to it. That way would work I’m certain if I could figure it out. I can’t. The only documentation for using the clipboard deals with copying text to it (the really stupid case).

I ended up implementing it by creating a hidden image on a page, which I shove the picture data into and then just order Firefox to copy it in the same way that “Copy Image” from the right-click menu does. It’s inelegant and required some fiddling, but it works fine now.