Skip to content

Errors / JavaScript errors

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided does not match the recipient window's origin

An embedded video or widget tried to talk to its frame before the frame had loaded; usually harmless.

Usually none; at worst the player's controls from the page (autoplay, tracking) do not work.

Why it happens

  • Most often a YouTube embed: the player script sends messages to the youtube.com frame while the frame is still about:blank or on youtube-nocookie.com.
  • Any code calling postMessage(data, "https://…") at a frame whose current origin differs from the one given.

How to fix it

  1. For YouTube, set origin= in the embed URL to your site, and create the player after its iframe has loaded.
  2. For your own code, wait for the frame's load event, and pass the frame's real origin.
  3. It is logged by the browser and cannot be caught, so error trackers often record it as if it were the site's own error. If every embed plays and responds, filter it out; if a player never starts or its events never arrive, the frame and the script disagree about the origin, and that is worth fixing.

Whose problem it is

Usually another company's script or site, embedded in this one.

Does your site have it?

Free, no account. We open your page and four more in a clean Chrome and list every error like this one, with the page and the click that caused it. How the free page check works.

Check only sites you run or have permission to check.