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
335 stars 59 forks source link

Dynamically edit Content-Security-Policy #150

Closed laclance closed 2 years ago

laclance commented 2 years ago

Trying to connect to a "random" websocket address but then it seems will need some way of being able to dynamically add the address to the Content-Security-Policy once it is known.

create-or-join.ts:99 Refused to connect to 'ws://10.0.0.7:8082/' because it violates the following Content Security Policy directive...

IT-MikeS commented 2 years ago

Are you wanting to edit the CSP after the web app is loaded into the renderer?

laclance commented 2 years ago

yeah because the websocket address is selected by the user.

IT-MikeS commented 2 years ago

You may not be able to do that, or you'll have to remove the CSP. Can't say I know for certain if it's not possible though

laclance commented 2 years ago

ok thank you.

Estevete commented 1 year ago

You may not be able to do that, or you'll have to remove the CSP. Can't say I know for certain if it's not possible though

How can I remove the CSP? I'm facing the same issue.