# Embedded chat breaks after raids

**URL:** <https://discuss.dev.twitch.com/t/embedded-chat-breaks-after-raids/32107>\
**Category:** Chat and IRC\
**Created:** [June 12, 2021, 10:19am UTC](https://discuss.dev.twitch.com/t/embedded-chat-breaks-after-raids/32107 "2021-06-12T10:19:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aho](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@aho](https://discuss.dev.twitch.com/u/aho)\
**Post date:** [June 12, 2021, 10:19am UTC](https://discuss.dev.twitch.com/t/embedded-chat-breaks-after-raids/32107/1 "2021-06-12T10:19:26Z")

</div>

I’ve embedded `https://www.twitch.tv/embed/<channel>/chat?darkpopout&parent=<domain>` on a site. When `<channel>` raids another channel, call that `<target>`, the frame is redirected to `https://www.twitch.tv/<target>/chat?darkpopout&no-reload=true&parent=<domain>&referrer=raid`.

The problem is, the latter page doesn’t send the appropriate Content-Security-Policy with the parent domain in `frame-ancestors`; instead it has `X-Frame-Options: SAMEORIGIN`, so the embed breaks because of a CORS error.

An appreciated fix would be to change the redirect target to `https://www.twitch.tv/embed/<target>/chat?darkpopout&parent=<domain>`, or better yet, give an option to disable redirects on raids.

---

<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 12, 2021, 11:43am UTC](https://discuss.dev.twitch.com/t/embedded-chat-breaks-after-raids/32107/2 "2021-06-12T11:43:04Z")

</div>

Issue 246 has reoccured it would seem

> <https://github.com/twitchdev/issues/issues/246>
>
> \*\*Brief description\*\*
> 
> When a raid occurs, the embed tries to follow the raid …and dies
> 
> \*\*How to reproduce\*\*
> 
> Make a embed go on a raid
> 
> \*\*Expected behavior\*\*
> 
> Not sure what the correct behaviour is
> 
> \*\*Screenshots\*\*
> 
> Strippin (bottom) raided JesseCox (top)
> 
> Resulting in a dead embed
> 
> !\[image\](https://user-images.githubusercontent.com/20999/97245281-9be60680-17f2-11eb-9eef-79429fde2b49.png)
> 
> \`www.twitch.tv failed to connect\`
> 
> \`Refused to display 'https://www.twitch.tv/jessecox?channel=strippin&height=480&migration=true&parent=myvalidparemt&referrer=raid&theme=dark&width=100%25' in a frame because it set 'X-Frame-Options' to 'sameorigin'\`

Have requested it be reopened

---

<div class="post-metadata">

**Author:** ![system](https://d2opxh93rbxzdn.cloudfront.net/original/2X/0/05909729875cce3b53e59d5561c4d23bb14948fc.png) [@system](https://discuss.dev.twitch.com/u/system)\
**Post date:** [July 12, 2021, 11:43am UTC](https://discuss.dev.twitch.com/t/embedded-chat-breaks-after-raids/32107/3 "2021-07-12T11:43:30Z")

</div>

Closed on July 12, 2021, 11:43am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
