Because an ancestor violates the following Content Security Policy directive: "frame-ancestors

Hello, I want to put a broadcaster’s chat on Twitch on my own site, but I am getting an error. Is there anyone who can help solve this problem?

I was getting the same error when I wanted to add a live broadcast. I can solve this problem with JavaScript, but I cannot do the same solution for chat.

code :

<iframe
  id="chat_embed"
  src="https://www.twitch.tv/embed/buselinko/chat?parent=www.ayintaplogistic.com.tr"
  height="500"
  width="350">
</iframe>

error (console):


Refused to frame 'https://www.twitch.tv/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://www.ayintaplogistic.com.tr".

example web site :

https://etkinlik.ayintaplogistic.com.tr/yayinci.php

You’re parent param is wrong. If the site is https://etkinlik.ayintaplogistic.com.tr/yayinci.php then the parent would be etkinlik.ayintaplogistic.com.tr, not www.ayintaplogistic.com.tr.

1 Like

Thank you very much !! thanks to you it works now.