Muhammad Adeel Zahid
Muhammad Adeel Zahid

Reputation: 17784

Invalid value for Content Security Policy: Google Chrome Extension

I have been updating manifest_version of our chrome application and struggling a little bit with content_security_policy. They have stopped support for inline js and so many things. I wanted to relax this restriction by adding following line in my manifest

"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"

When I try to load unpacked extension from chrome, it gives me an error message Invalid value for content_security_policy. Ironically, I have copied this line from google's developer documentation for chrome extension (plz see the section "Evaluated Javascript")

Edit: Google thread states that unsafe-eval is not supported in manifest version 2. How would I now use jquery and similar scripts that, I think, requires unsafe-eval?

Upvotes: 3

Views: 4249

Answers (1)

Konrad Dzwinel
Konrad Dzwinel

Reputation: 37903

unsafe-eval is mentioned in development, trunk and beta version of documentation, but it's missing in stable docs. You will probably have to wait for current beta to became stable. Till then you can test your extension on Chrome Canary.

Upvotes: 3

Related Questions