securingsincity / react-ace

React Ace Component
http://securingsincity.github.io/react-ace/
MIT License
4.02k stars 603 forks source link

Issue with CSP #1832

Open MartinezVillaresAdrian opened 1 year ago

MartinezVillaresAdrian commented 1 year ago

Hello, I have an issue that you might be able to help me with.

In my current project, I need to remove 'unsafe-inline' CSP header for the 'style-src' .

I've been reading a lot of comments in the ace repository and they all leave me to the next solution

ace.config.set('useStrictCSP', true)

I tried that and the errors from the CSP are gone, but the editors are not working, I guess that's because the styles are not being loaded anymore.

Have you ever faced that issue?, is it possible to set up a nonce for the editor ?

Regards

FrogSky commented 11 months ago

the same question

nickmealey commented 2 months ago

I'm seeing the same thing. Any updates on this?

MartinezVillaresAdrian commented 2 months ago

Hello!!

I also asked the same question in ace repo and they gave me an answer, here is the link.

https://github.com/ajaxorg/ace/issues/5452

Basically you need to have the custom styles added as . CSS files and import them on your index.css file.

MartinezVillaresAdrian commented 2 months ago

Hello!!

I also asked the same question in ace repo and they gave me an answer, here is the link.

https://github.com/ajaxorg/ace/issues/5452

Basically you need to have the custom styles added as . CSS files and import them on your index.css file.