Blocked a frame with origin ... from accessing a frame with origin


I’m place the iframe with stream, for example

on my site https://… and there are a lot of console errors “Blocked a frame with origin “” from accessing a frame with origin “https://…” requesting access set “document.domain” to “”, but the frame being accessed did not. Both must set “document.domain” to the same value to allow access”

How I can fix it? Thanks

Is this causing problems with playback?

No problems with playback, just spamming 1000+ errors in console log in Safari

Do you have adblock on? I just tested this with and without adblock. With adblock, I see errors every few seconds due to our statistics library being blocked. Without adblock, I get no errors at all.

adblock was on, but when I put it on pause, nothing change =(

You mean when you pause you still get the errors? There are still statistics events firing even when the player is paused.

When adblock on pause and stream is live there are a lot of errors - screen

The player is trying to crawl up for information from the top level frame, which is blocked by CORS policy (IFrames are considered a cross-origin resource, as they are a completely separate document context). If I could get to the page you were on, I might be able to pinpoint the root cause through the client.js and player.js files.

Unless these errors are causing site performance issues (Failing on setting document.domain is really cheap, so I doubt this is causing performance issues), then you might be able to move on to continuing development in other areas. It is worth noting that Twitch isn’t the only frame resource that will do that. Depending on your browser (Safari is really…really bad with reporting this, whereas Chrome, FF and Edge are pretty lax on reporting this), you will see hundreds of thousands of these on any website running remnant advertisements. It is worth noting that this error is not associated with bandwidth costs either, so the user impact, again, assuming there is no performance degradation, is completely negligible.

It’s most likely caused by the player checking whether it’s embedded on the official website or not.

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