-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
support cross-origin fromDataURL #399
Comments
+1 |
this my code and it works.
|
Fixed by #542. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you have a question, please ask it on StackOverflow and use
signature-pad
tag instead of creating an issue.Do you want to request a feature or report a bug?
Add support for loading signature Cross Origin with
fromDataURL
.What is the current behavior?
In Firefox (possibly/likely other browsers as well) if I attempt to load a signature image from a domain other than the origin (for example if the signatures are stored on S3/cloudflare) then future attempts to call toDataURL result in a SecurityError due to "tainted canvas", as explained here https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/szimek/h80phxyr/).
https://jsfiddle.net/ab27n8f3/1/
Then click the save as PNG or JPG buttons and note the error in the console.
SecurityError: The operation is insecure.
(Firefox)Chrome:
What is the expected behavior?
Support cross origin requests for image signatures
Which versions of SignaturePad, and which browser / device are affected by this issue? Did this work in previous versions of SignaturePad?
Signature Pad 2.3.2
Firefox 62.0.3
I believe the solution is to add just one line to
fromDataURL
, after:const image = new Image();
add the following after:
image.crossOrigin = "Anonymous";
The text was updated successfully, but these errors were encountered: