capacitor-community / electron

Deploy your Capacitor apps to Linux, Mac, and Windows desktops, with the Electron platform! 🖥️
https://capacitor-community.github.io/electron/
MIT License
319 stars 58 forks source link

ionic electron Error blob #160

Closed salemdomain closed 2 years ago

salemdomain commented 2 years ago

hi,

Does anyone know what the cause of this error?

Refused to connect to 'blob:capacitor-electron://-/72d107ae-1e8b-49c0-82b5-4462b629eaa9' because it violates the following Content Security Policy directive: "default-src capacitor-electron:// 'unsafe-inline' devtools:// 'unsafe-eval' data:". Note that 'connect-src' was not explicitly set, so 'default-src' is used as a fallback. zone.js:1523 Refused to connect to 'blob:capacitor-electron://-/72d107ae-1e8b-49c0-82b5-4462b629eaa9' because it violates the document's Content Security Policy.

am trying to upload image and converting the blob to base64 for live reviewing the image, but i get the above error after selecting the image, i have tried to add <meta but no luck, can anyone help?

jdgjsag67251 commented 2 years ago

The blob: source is not added to the CSP by default. You could add it manually in the setupContentSecurityPolicy function

IT-MikeS commented 2 years ago

@jdgjsag67251 Is correct