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

Canvas CORS error on Firefox #242

Closed
dadepl opened this issue Aug 2, 2022 · 7 comments
Closed

Canvas CORS error on Firefox #242

dadepl opened this issue Aug 2, 2022 · 7 comments
Labels
Released The issue is fixed/considered and released

Comments

@dadepl
Copy link

dadepl commented Aug 2, 2022

Hi,

i'm getting error on script initialization on Firefox:

Konva error: Unable to apply filter. The operation is insecure. This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.

I'm using Vanilla JS approach and get latest JS from CDN - https://scaleflex.cloudimg.io/v7/plugins/filerobot-image-editor/latest/filerobot-image-editor.min.js
As mentioned in Konvajs link I have checked that crossOrigin = Anonymous is added in editor script - it is. Also my S3 from which I'm getting files to editor is responding with proper Access-Control-Allow-Origin header. And then I found that the problem that my Firefox has is order of assigning attributes to newly created image object. Part of code from above compressed JS:

{return new Promise((function(n,r){var i=new Image;i.src=e,i.crossOrigin="Anonymous",i.name=null!=t?t:KI(e),i.onload=function(){n(i)},i.onerror=function(){r(new Error("Error in loading the image with the provided url: ".concat(e)))}}))}

When I move this part:

i.crossOrigin="Anonymous"

before:

i.src=e

I have no error on Firefox:

{return new Promise((function(n,r){var i=new Image;i.crossOrigin="Anonymous",i.src=e,i.name=null!=t?t:KI(e),i.onload=function(){n(i)},i.onerror=function(){r(new Error("Error in loading the image with the provided url: ".concat(e)))}}))}

Does anyone else have such problem on Firefox? Could you please check and fix CDN JS if needed?

@GregoryPotdevin
Copy link

We are currently seeing the same error using the CDN version, and it worked a few days ago when we implemented this code.
Using Chrome

@SaraZoarob
Copy link

hello @dadepl, @GregoryPotdevin we will check and get back to you

@SaraZoarob SaraZoarob added the TBD To Be Defined means that issue needs to be checked and re-labeled after checking label Oct 2, 2022
@AhmeeedMostafa AhmeeedMostafa added Waiting release The issue's code is added in the dev. branch but not yet released and removed TBD To Be Defined means that issue needs to be checked and re-labeled after checking labels Nov 14, 2022
@techistoner
Copy link

remove crossOrigin="Anonymous" image can display,but finetune fliters will be invalid ,any update?

@AhmeeedMostafa AhmeeedMostafa added Released The issue is fixed/considered and released and removed Waiting release The issue's code is added in the dev. branch but not yet released labels Feb 10, 2023
@AhmeeedMostafa
Copy link
Collaborator

The issue is fixed in version 4.3.8, please re-check it and let us know if all is good.

@ArturTovmasyan
Copy link

Hi @SaraZoarob. It still returns a Cors error. We use "filerobot-image-editor": "^4.4.0", version.

@rahulvramesh
Copy link

same issue here

@AhmeeedMostafa
Copy link
Collaborator

@ArturTovmasyan @rahulvramesh please post some more info? make sure ur server has "Access-Control-Allow-Origin" header in ur response?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released The issue is fixed/considered and released
Projects
None yet
Development

No branches or pull requests

7 participants