# Failed to execute 'postMessage' on 'DOMWindow'

**URL:** <https://meta.discourse.org/t/failed-to-execute-postmessage-on-domwindow/296690>\
**Category:** Support\
**Tags:** embedding\
**Created:** [February 26, 2024, 12:07am UTC](https://meta.discourse.org/t/failed-to-execute-postmessage-on-domwindow/296690 "2024-02-26T00:07:41Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Joseph3](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joseph3/32/365522_2.png) [@Joseph3](https://meta.discourse.org/u/Joseph3)\
**Post date:** [February 26, 2024, 4:22am UTC](https://meta.discourse.org/t/failed-to-execute-postmessage-on-domwindow/296690/5 "2024-02-26T04:22:31Z")

</div>

Hi Simon, I originally had the issue of not having the username for topic creation correct within the Discourse admin panel. But I fixed it to show JosephPaul within the panel as well as within:  
`<meta name='discourse-username' content='JosephPaul'>`

So those are correct to my knowledge.

I also had a look at the second link you sent, and I believe everything is correct. I just tried switching my Discourse site to not require sign-in and that did not solve the issue.

The issue persists even with newly generated posts.

Edit:  
I have attempted again to follow some of the suggested embed URL changes in the above post. The following code is recreating the error:

```plaintext
<script type="text/javascript">

setTimeout(5000)
  DiscourseEmbed = {
    discourseUrl: 'https://forum.josephpaul.com/',
    discourseEmbedUrl: 'https://josephpaul.com{{page.url}}' };

  (function() {
    var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
    d.src = DiscourseEmbed.discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
  })();
</script>

```

Additional troubleshooting attempt following Simon’s thread:

I have set the embed URL to also include www. as a user suggested. The following error now occurs:

```plaintext
Referer:`https://josephpaul.com/test-post/`

The referer was either not sent, or did not match any of the following hosts:

josephpaul.com

```

---

_[View the full topic](https://meta.discourse.org/t/failed-to-execute-postmessage-on-domwindow/296690)._
