Search code examples
javascriptgoogle-chrome-extensiongoogle-chrome-appcontent-security-policychrome-plugins

Error while accessing iframe from chorme extension, content_security_policy error


I am trying to access the Iframe from the chrome plugin and get the below error.

Refused to frame 'https://mysite.co/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors *".

I have already added this below line in my menifest.json file but it not works.

"content_security_policy": "script-src 'self' https://mysite.co/"

Please guide.


Solution

  • I found the solution, I have to add child-src for the iframe as below.

    "content_security_policy": "script-src 'self' https://mysite.co; child-src https://mysite.co; object-src 'self'"