Skip to content
This repository has been archived by the owner on Oct 28, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants