Simple Twitch chat integration fails, login page shows Twitch index page

After prowling the forums a bit, I’m seeing repots of Javascript errors with the iframe-embedded chat application. I’m getting them, and it looks like it has to do with recent changes in the browsers. I’ve seen that people were commenting about this at least two years ago, but it seems to be an ongoing issue:

I believe it’s correct to say that the scripts won’t load because the cookies have the wrong values set.

My embed code is straight out of the book, pure vanilla:

<div class="twitch-chat">
    <iframe
      frameborder="0"
      scrolling="no"
       src="https://www.twitch.tv/embed/{mychannel}/chat?parent={mysite}.com"
      height="100%"
      width="100%">
    </iframe>
  </div>

To be fair, this embed worked exactly one time, a very long time ago, and hasn’t worked since. Behavior is the same in Chrome, Firefox, and Brave, both on desktop and on mobile: what happens is that if you try typing anything in the comment box, a window appears that takes you to the twitch.tv homepage.

Has this type of embed been deprecated? If so, why is it shown in all the online documentation?

Thank you, random stranger, for your time and consideration…!

Update: I may have solved…part of it. In Firefox, turning off add-ons like Privacy Badger for Twitch’s resource servers made it possible for me to use the chat window as expected. I’m not sure what settings are required in Chrome and Brave to mimic this behavior, but I expect it to be along those lines. That being said, it’s not going to work to ask users to modify browser settings; most are non-technical (at best).

There’s your problem.

Privacy and other script blocking (and event adblocking) extensions interfere with how websites operate and can thus result in embeds and other things not working as expected.

Brave is it’s own pile of mess. And some browser settings will turn off “basic” web technologies causing the interruption to services.

Your embed is fine the problem is what the user has installed.