I'm not sure I understand you question correctly but I'm going to to answer anyway
- There is experimental Chrome API to capture visible page
- There is a lot of capture extensions in the WebStore, they used canvas to capture current page if I recall correctly, but I checked this long time ago. However you could check their code. I'm not sure if you asked about extension only code or about client code as well but I suspect such approach would work for client scripts as well
Hope this helps. Drop me the message if you need help with such extension development