question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to execute 'postMessage' on 'DOMWindow'

See original GitHub issue

Embedding video to the page causes this error in the console: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin (*host name*)

“Angular YouTube Embed” has the same problem.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:17
  • Comments:5

github_iconTop GitHub Comments

5reactions
renetikcommented, May 21, 2019
<template>
  <iframe :height="height" :src="youtubeUrl()" :width="width"/>
</template>

<script lang="ts">
  import { Component, Prop, Vue } from 'vue-property-decorator'

  @Component
  export default class CSYoutubeVideo extends Vue {

    @Prop({ required: true }) videoId!: string
    @Prop({ required: true }) width!: string
    @Prop({ required: true }) height!: string

    youtubeUrl(): string {
      return `https://www.youtube.com/embed/${this.videoId}?modestbranding=1&playsinline=0
      &showinfo=0&enablejsapi=1&origin=${window.location.origin}&widgetid=1`
    }
  }
</script>

1reaction
Anploecommented, Oct 2, 2018

i yust had the same issue and at least in my local enviroment setting :player-vars=“{origin:‘http://mydomain.local’}” seems to solve the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to execute 'postMessage' on 'DOMWindow': https://www ...
I believe this is an issue with the target origin being https . I suspect it is because your iFrame url is using...
Read more >
Failed to execute 'postMessage' on 'DOMWindow ... - GitHub
Hi David, I face an issue when using your scripts in sharepoint sites. Failed to execute 'postMessage' on 'DOMWindow': The target origin (https://....
Read more >
Failed to execute 'postMessage' on 'DOMWindow'
Youtube player widget, out of nowhere, started to show errors in browser console. www-widgetapi.js:758 Failed to execute 'postMessage' on 'DOMWindow': The ...
Read more >
JavaScript : Failed to execute 'postMessage' on 'DOMWindow'
JavaScript : Failed to execute ' postMessage' on 'DOMWindow ': https://www.youtube.com !== http://localhost:9000 [ Gift : Animated Search ...
Read more >
Failed to execute 'postMessage' on 'DOMWindow': The target ...
Currently, I'm facing an issue. Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://companyName--c.visualforce.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found