Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR SecurityError on IE 11 #21

Open
vipinshukla5805 opened this issue Jun 22, 2017 · 5 comments
Open

ERROR SecurityError on IE 11 #21

vipinshukla5805 opened this issue Jun 22, 2017 · 5 comments

Comments

@vipinshukla5805
Copy link

I am getting ERROR SecurityError on IE 11.

Please suggest any solutions.

@dsamarin
Copy link
Collaborator

Are you using this with a tainted canvas?

Although you can place images/other media without CORS approval in your canvas, doing so taints the canvas. Once a canvas has been tainted, you can no longer pull data back out of the canvas. For example, you can no longer use the canvas toBlob(), toDataURL(), or getImageData() methods; doing so will throw a security error.

@iamdevlinph
Copy link

iamdevlinph commented Jun 22, 2017

How about when we're just converting our svg to canvas then to blob.

In what way is the canvas will be tainted?

@dsamarin
Copy link
Collaborator

dsamarin commented Jun 22, 2017

If the SVG file contains any references to external sources (CSS, objects, images etc.) it won't work. Everything in the SVG must be inlined. Or else you will have the same situation as using external resources directly, but as they are encapsulated in a SVG the browser is more strict. So you cannot use CORS in these cases.

This is a security feature of the browser and you can't change much about it but to make sure all resources needed for the SVG are embedded. Even then there are some known unavoidable browser quirks.

There is a library called canvg that claims to be able to get around this.

Sent from my Google Pixel XL using FastHub

@iamdevlinph
Copy link

iamdevlinph commented Jun 22, 2017

So does this mean, even though the files are loaded locally, or maybe even minified, the canvas will always be tainted unless we literally put the styles inline?

@ibenzyk
Copy link

ibenzyk commented Mar 7, 2019

same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants