I'm thinking about refactoring the code to make it easy for other extensions to capture pages. I thought I'd outline the approach here to see if you're interested & if it sounds reasonable.
I'd move the popup JS that talks to the content script into a separate file. There'd be a function that you'd call to ask for a capture of the current tab. You'd pass it a callback, which would be called with the image (the blob, I guess). The current extension could do its current thing, just using the extracted code as an API.
Then if someone else (me, for example) wanted to integrate screen captures, they'd just grab that extracted JS and the page.js file, etc.
I'd probably replace the communications with a named port that gets opened and closed so as to be isolated from any other comms going on in an extension that incorporated the capture API code.
It'd also be possible to just make a new github repo with only the code for the capture functionality, and no extension. Then this extension and others could use a git submodule to have access to the code. For now though I think it's fine just to separate the capture code from the usage of the result, the pac-man progress indicator, etc.
I want to add capture to an extension I have. So I'm going to do this kind of work in any case, but it'd be much better to not simply fork the existing code (although that would be quicker in the short term :-))
Thoughts?