ng2-canvas-whiteboard
ng2-canvas-whiteboard copied to clipboard
Fix for CORS images on canvas
Loading an image as background from another domain is possible, but when saving the image an error is thrown (Firefox).
ERROR DOMException: The operation is insecure.
This happens when calling the canvasToDataUrl on a canvas.
More information: https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image
Hi, I am not sure about merging the PR, please check this issue and the comments about why Cors taints the canvas as a security feature and how to overcome it
https://github.com/webfactorymk/ng2-canvas-whiteboard/issues/8
The problem is that sometimes that there are no efficient ways to overcome this. For example a CDN server , even on the same top domain. Loading it through a proxy to map it to a base64 would add some extra delay/bandwidth.
How about I make this a property to allow 'insecure' image loading? The default would be not to allow this, except if we enable the feature through a property?