Propagate CSP to child scripts like vscode-loader
madhukivera opened this issue · comments
Describe the bug
We are unable to add CSPs for Monaco React because the underlying monaco-editor uses inline style injections. While there is a long lasting issue microsoft/monaco-editor#271 to ask for Monaco Editor itself to support CSPs, they have been ignoring it for a long time.
Meanwhile the vscode-loader had made a workaround to propagate nonce to all child elements microsoft/vscode-loader#15
Some one even tried to add hashes, but it seems Monaco uses them dynamically on each load and there is no point to adding them:
microsoft/monaco-editor#271 (comment)
We need this to be implemented in monaco-react/loader
To Reproduce
- Add CSP
- See the styles break
- Add unsafe-inline
- See everything working