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

Fix for CORS images on canvas #67

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Elvander
Copy link

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

@Peshou
Copy link
Collaborator

Peshou commented Sep 21, 2020

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

#8

@Elvander
Copy link
Author

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?

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

Successfully merging this pull request may close these issues.

2 participants