[solved] Embedded chat on localhost can no longer load messages

Hello!

I’ve built a simple webpage to have as an overlay in VR that displays the Twitch chat and the viewer count, time etc. It has worked up until just recently, but now it doesn’t get new messages for the chat anymore with no changes made to my local server or the code. Have there been any changes on Twitch’s end, like moving the embed to HTTPS?

This is the message I get:

emberchat-16dc1db….js:120 Uncaught SecurityError: Blocked a frame with origin “https://www.twitch.tv” from accessing a frame with origin “http://localhost”. The frame requesting access has a protocol of “https”, the frame being accessed has a protocol of “http”. Protocols must match.

If I convert my page to use SSL I get this error instead, chat still loads, but it fails getting messages.

emberchat-16dc1db….js:120 Uncaught SecurityError: Blocked a frame with origin “https://www.twitch.tv” from accessing a frame with origin “https://localhost”. The frame requesting access set “document.domain” to “twitch.tv”, but the frame being accessed did not. Both must set “document.domain” to the same value to allow access.

I’m embedding: //www.twitch.tv/[channel]/chat with an iframe. I’m not using any authentication to sign in or anything like that, I’ve just had the text coming in without replying non-verbally.

Again, I had the chat working just a week or two ago, but now when I started this up again it’s not working. Any information regarding this would be fantastic.

Oh, is this true. I’ve been sitting with this for 1.5 hours, I post this, go and take a drink, come back and now things work. I have no idea why. I still have the same error messages for both HTTP and HTTPS, but chat is streaming along just fine like it used to. Well… uh. Thanks I guess.

You’ll see the console errors but everything should work without issue. If you’re not seeing things work, let me know!

The “errors” are just the embedded chat detecting if the page is embedded on Twitch or a 3rd party site.

I think I found one thing that caused confusion for me.

  1. Loading chat from here: https://www.twitch.tv/[channel]/dashboard
  2. And stream info from here: https://api.twitch.tv/kraken/streams/[channel]

When loading the chat, it’s actually case sensitive on the channel name, which means my username but in lower case. The stream info though takes upper or lower case, either one. I used a single in parameter to initiate my page, the same channel name is used in both URLs, and when the stream info worked and not the chat I got confused -_-

Add that I tried other channel names, but copy pasted them, and depending on if they had capital letters in their names or not they worked or didn’t work. Wow. So many gray hairs just to discover this. Well, now I know what’s going on in any case :stuck_out_tongue:

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