Even though I put “allow-same-origin” in the sandbox attribute of the HTML, I get the error “Refused to display ‘https://www.twitch.tv/’ in a frame because it set ‘X-Frame-Options’ to ‘sameorigin’.” An error occurs.
If I were to embed the chat in the normal way, I wouldn’t be able to use the “options for running the chat as a popup” like setting the dark mode, so I put the link “Twitch” in the src of the iframe instead of “Twitch”.
The SOP error popped up in the console window of the devtool, so I looked for the API documentation and realized that there was a sandbox option, so I put that in and got the same error.
To see if it was just a link issue, I tried putting in a normal link (Twitch) minus the parent=~~~ part, and got the same error (‘X-Frame-Options’ to ‘sameorigin’).
Is there a workaround for that error, or is it possible to embed the popup directly?
If so, how should I use the https://dev.twitch.tv/docs/embed/chat/에서 Parameters-sandbox part?
There doesn’t seem to be any difference between using it and not using it, so am I using it wrong? Or is it not supported right now?
sandbox
Applies extra restrictions to the content in the frame. The value of the attribute can either be empty to apply all restrictions, or space-separated tokens to lift particular restrictions:
But if you add more than Twitch needs, Twitch doesn’t honor/add the extra permissions, hence trying to override the X-Frame-Options does nada.