CSP (Content Security Policies)

Hello everyone,
my name is Dominik and I have been working with Angular and the IONIC framework for more than 4 years.

I have a large IONIC project in which I display the contents of an HTML file in modals (configurable by the user). I use a backend from which data can be retrieved and displayed in the project and manipulated.

Now to my problem. I use CSP, among other things, to secure the page. However, if I set “srcipt-src” to “self”, opening modals and fetching data no longer works.

I have already tried Google, but it keeps recommending CSP hashing. Unfortunately, I can’t get any further here because I don’t know exactly how to use it.

Can anyone recommend a tutorial or instructions?

Thank you!

Best regards
Dominik

From Capacitor’s docs, it looks like you need to set self and the domain you want to connect to.