# Refused to frame 'https://embed.twitch.tv/' because an ancestor violates the following Content Security Policy directive

**URL:** <https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269>\
**Category:** API\
**Created:** [June 11, 2020, 11:37pm UTC](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269 "2020-06-11T23:37:14Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Steven\_Petruzzelli](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/steven_petruzzelli/32/8744_2.png) [@Steven\_Petruzzelli](https://discuss.dev.twitch.com/u/Steven_Petruzzelli)\
**Post date:** [June 13, 2020, 5:54am UTC](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269/22 "2020-06-13T05:54:42Z")

</div>

Yes, much appreciated. This was not a problem until a couple days ago.

---

<div class="post-metadata">

**Author:** ![Dist](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/dist/32/7192_2.png) [@Dist](https://discuss.dev.twitch.com/u/Dist)\
**Post date:** [June 13, 2020, 7:58am UTC](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269/23 "2020-06-13T07:58:48Z")

</div>

> [@regex\_rex](#):
>
> Hopefully twitch can get this resolved soon, or provide info on whatever embed requirements/changes they have implemented because it’s a pretty big issue.

Changes were announced over 4 months ago, along with info on how to comply with these new changes.

If using a parent param is still not working for you, then you’ve either entered it erroneously (eg, you’ve included things other than the domain portion, such as protocol, port, or path, which should not be included), not included every parent (if you’re using a site-builder such as wix then they will put your content inside another iframe, ALL parents must be included so you need to include every iframe your embed is within as parents), or you’re not serving your page over HTTPS which is a requirement now (with the exception being localhost or 127.0.0.0/8 parents where HTTPS is not required).

> [@Steven\_Petruzzelli](#):
>
> Sure, the link is [https://sourceinvite.wixsite.com/sourceinvite/streams](https://sourceinvite.wixsite.com/sourceinvite/streams). It works in internet explorer 11, though, which is odd. The original code I posted, that is.

I don’t see an embed on the page you linked, so I can’t help you.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 13, 2020, 11:07am UTC](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269/24 "2020-06-13T11:07:22Z")

</div>

> [@Steven\_Petruzzelli](#):
>
> I would need the iframe code though. I can try it if you have something that you think will work.

I have _no idea_ what the iframe is for wix’es editor is, I don’t use wix

> [@Steven\_Petruzzelli](#):
>
> any ideas barry?

I was asleep, there is no need to bump threads

> [@Steven\_Petruzzelli](#):
>
> it works fine on IE

IE is dead/deprecated doesn’t implement new browser features

Checking `https://sourceinvite.wixsite.com/sourceinvite/streams`

has the iframe of

[https://sourceinvite-wixsite-com.filesusr.com/html/ff247d\_a61dced71f0dc378928cbf0b15b78b5d.html](https://sourceinvite-wixsite-com.filesusr.com/html/ff247d_a61dced71f0dc378928cbf0b15b78b5d.html)

Which has no parents

```auto

<html>
  <body>
    <div id="twitch-embed"></div>
    <script src="https://embed.twitch.tv/embed/v1.js"></script>
    <script type="text/javascript">
      new Twitch.Embed("twitch-embed", {
        width: '100%',
        height: '100%',
        channel: "sourceinvite",
      });
    </script>
  </body>
</html>

```

Should be

```auto

<html>
  <body>
    <div id="twitch-embed"></div>
    <script src="https://embed.twitch.tv/embed/v1.js"></script>
    <script type="text/javascript">
      new Twitch.Embed("twitch-embed", {
        width: '100%',
        height: '100%',
        channel: "sourceinvite",
        parent: ["sourceinvite-wixsite-com.filesusr.com", "sourceinvite.wixsite.com"]
      });
    </script>
  </body>
</html>

```

 ![image](https://d2opxh93rbxzdn.cloudfront.net/original/2X/d/d91c17ec5fd68e8d1c6d4eed2d2304988a613a8c.png)

> [@regex\_rex](#):
>
> Running into the same issue here. Embed code worked fine up until a day or two ago. But now player/iframe will not load, with console debug showing something along the lines of (using Safari as example):

If you are using Wix please see the great big Wix thread

> [@The great big "I'm using WIX/SomeWebsiteMaking Tool and I don't know how to fix my embed" thread](https://discuss.dev.twitch.com/t/the-great-big-im-using-wix-and-i-dont-know-how-to-fix-my-embed-thread/26297/):
>
> If you are using WIX/Google Sites/Some other tool and your embeds are no longer working. The fix is as follows, it seems that wix and other website builders will put your embed in another iframe, so you need to include your website as a parent and that extra iframe as a parent. FOR WIX Generally it seems that for a wix site, your site is somesite.com And your iframe is somesite-com.fileusr.com or www-somesite.com.filesusr.com So your parent would be parent=somesite.com&parent=www.somesi…

Otherwise

> [@Twitch Embedded Player Updates in 2020](https://discuss.dev.twitch.com/t/twitch-embedded-player-updates-in-2020/23956/):
>
> Changes are coming to Twitch embedded experiences! We’re updating the way the embedded video player is initiated so that it takes advantage of all the performance improvements we’ve made to the on-site player over the last year. Today we’re announcing the first of multiple changes. Details and examples are included below to begin making code changes at your convenience. There is currently no deadline; a timeline will be provided via a future update to this post. Update (2020/05/13): These chan…

---

<div class="post-metadata">

**Author:** ![Steven\_Petruzzelli](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/steven_petruzzelli/32/8744_2.png) [@Steven\_Petruzzelli](https://discuss.dev.twitch.com/u/Steven_Petruzzelli)\
**Post date:** [June 13, 2020, 11:26pm UTC](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269/25 "2020-06-13T23:26:48Z")

</div>

I used this and it worked. for some reason it wasnt loading in the editor like it normally does. I had to publish it first and then after i published it it appeared on the live site. thanks for the help barry.

```
<html>
  <body>
    <div id="twitch-embed"></div>
    <script src="https://embed.twitch.tv/embed/v1.js"></script>
    <script type="text/javascript">
      new Twitch.Embed("twitch-embed", {
        width: '100%',
        height: '100%',
        channel: "sourceinvite",
        parent: ["sourceinvite-wixsite-com.filesusr.com", "sourceinvite.wixsite.com"]
      });
    </script>
  </body>
</html>

```

you can see it here [https://sourceinvite.wixsite.com/sourceinvite/streams](https://sourceinvite.wixsite.com/sourceinvite/streams)

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 14, 2020, 12:02am UTC](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269/26 "2020-06-14T00:02:44Z")

</div>

Yup all of our fixes don’t contain the fix for WIX’s editor just live

> [@Steven\_Petruzzelli](#):
>
> I used this and it worked. for some reason it wasnt loading in the editor like it normally does.

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 26, 2020, 10:50am UTC](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269/27 "2020-06-26T10:50:20Z")

</div>

A post was merged into an existing topic: [The great big “I’m using WIX/SomeWebsiteMaking Tool and I don’t know how to fix my embed” thread](https://discuss.dev.twitch.com/t/the-great-big-im-using-wix-somewebsitemaking-tool-and-i-dont-know-how-to-fix-my-embed-thread/26297/143)

---

<div class="post-metadata">

**Author:** ![BarryCarlyon](https://d3ovvz0v2ajtpu.cloudfront.net/user_avatar/discuss.dev.twitch.com/barrycarlyon/32/253_2.png) [@BarryCarlyon](https://discuss.dev.twitch.com/u/BarryCarlyon)\
**Post date:** [June 26, 2020, 10:52am UTC](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269/28 "2020-06-26T10:52:25Z")

</div>



[Previous page](https://discuss.dev.twitch.com/t/refused-to-frame-https-embed-twitch-tv-because-an-ancestor-violates-the-following-content-security-policy-directive/26269.md?page=1)
