How do you get the screenshot as a gif?
The simplest way would be to get a snapshot as a png first, then you can run some JavaScript with either the browser object or your own plugin. You would:
1. Load the base64 into a image. This is done asycronously.
2. When the image is loaded, draw that image to a canvas of the same size.
3. Utilize a JavaScript gif library to take the canvas and spit out a base64 gif.
Skipping to just 3 and using c2's canvas likely won't work when webgl is used. Otherwise notice you cannot get away from base64, so the buggy browsers you allude to will still have an issue. There are probably many gif JavaScript libraries you can find via Google. Any will do, and each is used differently.
However if after taking the screenshot you just want to load it again then converting it to gif first is a needless step.