<div dir="ltr">I'm able to capture the screen shot of the activity using <a href="http://html2canvas.hertzen.com/">http://html2canvas.hertzen.com/</a> <div><br></div><div>It captures the screenshot and returns a canvas.</div>
<div><br></div><div>Now to convert it to a png image I'm using: </div><div><br></div><div><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline">var previewImage = canvas</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline">.</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline">toDataURL</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline">(</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0)">"image/png;base64"</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline">);</span></div>
<div><br></div><div><div>The problem with this is that it throws a </div><div><br></div><div><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline">SECURITY_ERR</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline">:</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline"> DOM </span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(43,145,175)">Exception</span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;color:rgb(0,0,0);font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline"> </span><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0)">18</span></div>
</div><div><span class="" style="font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;background-color:transparent;font-size:14px;line-height:18px;margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(128,0,0)"><br>
</span></div><div>After reading a bit on this error, got to know that when the canvas has an element whose origin-clean flag is set to false, it would generate this error.</div><div>Not able to understand why exactly this is happening in Sugar though.<br>
<br>Is there a way around this? </div></div>