Trying to render iframe: ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'" Trying to render iframe: ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'" node.js node.js

Trying to render iframe: ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'"


As oreoshake points out, the problem here is not your CSP, but the CSP on GitHub. It is GitHub that is preventing you from framing them so there is nothing you can do with your CSP to resolve this.


The frame-ancestors value acts on the source of the iframe not the document framing it. Setting CSP on your page will have no effect on the framing. Think of frame-ancestors like X-Frame-Options on steroids: it restricts what is allowed to frame the content. Gist intentionally does not allow directly framing gists but instead provides a way to embed a Gist.

frame-ancestors 'none' == X-Frame-Options: DENY

enter image description here