Parent value string contains invalid character

I am trying to figure out what the invalid character is. The “my.domain.com” is not what my domain is, just a placeholder to hide the actual address.

Error:
[InvalidCharInParent] parent query string value contains invalid character

Code:

<iframe
    src="https://player.twitch.tv/?channel&parent=https://my.domain.com"
    height="720"
    width="1820"
    allowfullscreen="true">
</iframe>

Parent should be JUST the domain name no other characters

so

src="https://player.twitch.tv/?channel&parent=https://my.domain.com"

should be

src="https://player.twitch.tv/?channel&parent=my.domain.com"

also it should be channel=foo if that wasn’t clear

Thank you so much for the reply!

Whenever I publish my site and head over to my website my browser says;
"player.twitch.tv is blocked

player.twitch.tv refused to connect.

ERR_BLOCKED_BY_RESPONSE"

I also tried the channel=foo and that didn’t change anything for me.

Link to page with broken embed please

ah googlesites

you need a fix/setup similar to what is outlined here

Thank you again! My issue now is it’s not showing anything at all. Is there something I’m missing?

New code:

<iframe
  var parent = ['plus.destructomc.com', 'sites.google.com', 'www.gstatic.com', window.location.host];
  console.log(parent);
  document.getElementById('target_frame').setAttribute('src', document.getElementById('target_frame').getAttribute('src') + '&parent=' + parent.join('&parent='));

  var options = {
    width: 720,
    height: 1280,
    channel: "destructolive",
    allowfullscreen: true,
    layout: "video-with-chat",
    muted: true,
    parent
  };
  var player = new Twitch.Embed("test", options);
</iframe>

Errr yeah thats super invalid HTML…

You need a page that containts

<script src="https://embed.twitch.tv/embed/v1.js"></script>
<div id="test"></div>

<script type="text/javascript">
  var parent = ['sites.google.com', 'www.gstatic.com', window.location.host];
  console.log(parent);
  document.getElementById('target_frame').setAttribute('src', document.getElementById('target_frame').getAttribute('src') + '&parent=' + parent.join('&parent='));

  var options = {
    width: 800,
    height: 500,
    channel: "monstercat",
    allowfullscreen: false,
    layout: "video-with-chat",
    muted: true,
    parent
  };
  var player = new Twitch.Embed("test", options);
</script>

I’m sorry I’m not a scripter so I have no idea what I am doing lol. I used your script and filled in the placeholders, I’m still only seeing a blank page.

<script src="https://embed.twitch.tv/embed/v1.js"></script>
<div id="test"></div>

<script type="text/javascript">
  var parent = ['sites.google.com', 'plus.destructomc.com', window.location.host];
  console.log(parent);
  document.getElementById('target_frame').setAttribute('src', document.getElementById('target_frame').getAttribute('src') + '&parent=' + parent.join('&parent='));

  var options = {
    width: 720,
    height: 1280,
    channel: "destructolive",
    allowfullscreen: true,
    layout: "video-with-chat",
    muted: true,
    parent
  };
  var player = new Twitch.Embed("test", options);
</script>

Try this:

<script src="https://embed.twitch.tv/embed/v1.js"></script>
<div id="test"></div>

<script type="text/javascript">

  var parent = ['sites.google.com', 'www.gstatic.com', 'plus.destructomc.com', window.location.host];

  var options = {
    width: 720,
    height: 1280,
    channel: "destructolive",
    allowfullscreen: true,
    layout: "video-with-chat",
    muted: true,
    parent
  };
  var player = new Twitch.Embed("test", options);
</script>

Google threw an extra iframe into the stack

Oh my goodness, thank you so much. Saved me probably hours of headaches.