[html5] toDataURL calling itself causes security error

chris at martinilab.com chris at martinilab.com
Thu Jun 18 10:53:07 PDT 2009


Clever me thinking I could come up with a undo script.  I ended up with an error I can't get past.

var img = new Image();
img.src = canvas.toDataURL();
ctx.drawImage(img,0,0);

This only works once though.  The next time I use line 2.
img.src = canvas.toDataURL();

I get a security error even though img is created from the same script on the server.

The only way around this (and very ineffeciently I light add) is to post save the canvas to an image on the server.

This is happening on FireFox 3, I haven't checked Safari 4 though.

Is this working as it should?  Is it a bug?  Is there a better workaround than posting to the server?

Thanks!

Chris Williams
www.martinilab.com




More information about the Help mailing list