Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a CSP error in AngularJS 1?

Tags:

angularjs

I am trying to create a chrome plugin with AngularJS 1.5 dependencies. In that, I am getting this error.

EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self' blob: filesystem: chrome-extension-resource:".

I am not able to understand the problem behind this.

The same app is working fine for me on a web app. Why am I getting this error?

like image 461
Gary Lancaster Avatar asked Nov 17 '25 15:11

Gary Lancaster


1 Answers

Angular 1.5 uses some features that can conflict with certain restrictions that are applied when using CSP (Content Security Policy) rules.

At the header level, mention this.

Also, have a look at Angular ngCSP .

like image 192
Prateek Shankar Avatar answered Nov 20 '25 06:11

Prateek Shankar



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!