alexcorvi / heic2any

Converting HEIF/HEIF image formats to PNG/GIF/JPEG in the browser
https://alexcorvi.github.io/heic2any/
MIT License
585 stars 74 forks source link

Content Security Policy error #11

Open peterkracik opened 4 years ago

peterkracik commented 4 years ago

Hi, I'm getting this error:

Content Security Policy: The page’s settings blocked the loading of a resource at
blob:https://localhost/e674b31d-9638-6947-880b-d26cbd237e8d (“worker-src”).

what could be the reason and the solution?

skurgansky-sugarcrm commented 3 years ago

same on android in cordova app

skurgansky-sugarcrm commented 3 years ago

@peterkracik add this to your <head> in index.html

<meta http-equiv="Content-Security-Policy" content="
        default-src gap://ready file: blob: *;
        img-src 'self' data: file: blob: *;
        style-src 'self' 'unsafe-inline' file: blob: *;
        worker-src 'self' 'unsafe-inline' file: blob: *;
        script-src 'self' 'unsafe-inline' 'unsafe-eval' *;">
peterkracik commented 3 years ago

@skurgansky-sugarcrm thank you :) I had to find a different solution, but I hope it will help others!

mrctrifork commented 3 years ago

@peterkracik could you share which approach you took?

peterkracik commented 3 years ago

@mrctrifork actually we decided to don't allow to upload heic file at the end

mrctrifork commented 3 years ago

@peterkracik We are about to follow the same path…