Answer the question
In order to leave comments, you need to log in
How to get rid of "Tainted canvases may not be exported" error?
Chrome swears like this Uncaught SecurityError: Failed to execute 'toDataURL' on 'HTMLCanvasElement': Tainted canvases may not be exported. on this line in the code canvasImg = canvas.toDataURL("image/png");
I use html2canvas. An error occurs if the page is opened from some folder, if the page is uploaded to the server, then everything works fine there.
How to get rid of this error?
Answer the question
In order to leave comments, you need to log in
Tainted canvas - a canvas on which a drawing from another domain is displayed. Some operations (for example, .toDataURL) with such a canvas are considered a violation of the same origin policy.
For a file opened locally, any other domain is considered a violation of the same origin policy, hence the error.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question