# כשל הטמעת Discourse (הפניה מעורבבת)

**URL:** <https://meta.discourse.org/t/discourse-embed-fail-referer-mixed-up/201644>\
**Category:** Product Support\
**Created:** [25 באוגוסט,‏ 2021,‏ 8:18am UTC](https://meta.discourse.org/t/discourse-embed-fail-referer-mixed-up/201644 "2021-08-25T08:18:05Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![Bertrand\_Gorge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bertrand_gorge/32/228856_2.png) [@Bertrand\_Gorge](https://meta.discourse.org/u/Bertrand_Gorge)\
**Post date:** [25 באוגוסט,‏ 2021,‏ 8:18am UTC](https://meta.discourse.org/t/discourse-embed-fail-referer-mixed-up/201644/1 "2021-08-25T08:18:05Z")

</div>

Hello,

I’m in the process of embedding Discourse in a Mediawiki instance, and I seem to have a strange issue with it.

When I link my wiki page to an existing discourse topic, everything works like a charm:

```plaintext
window.DiscourseEmbed = { discourseUrl: 'https://forum.dev.tripleperformance.fr/',|
                          topicId: 18};

```

But when I try to create the topic it fails:

```plaintext
window.DiscourseEmbed = { discourseUrl: 'https://forum.dev.tripleperformance.fr/',|
                          discourseEmbedUrl = 'https:' + mw.config.get('wgServer') + '/wiki/' + mw.config.get('wgPageName')};

```

The iframe is loaded a first time with:

```plaintext
<meta id="data-embedded" data-referer="https://wiki.dev.tripleperformance.fr/wiki/Sandbox">

```

Then, after 30 seconds (caused by the `meta http-equiv="refresh"` in the iframe), the iframe reloads with:

```plaintext
<meta id="data-embedded" data-referer="https://forum.dev.tripleperformance.fr/embed/comments?embed_url=https%3A%2F%2Fwiki.dev.tripleperformance.fr%2Fwiki%2FSandbox">`

```

At this point, there’s an error in the console:

```plaintext
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://forum.dev.tripleperformance.fr') does not match the recipient window's origin ('https://wiki.dev.tripleperformance.fr').

```

That’s probably because the referer in the data-embedded attribute is now self and not the parent page (which might actually be expected since the initiator of the refresh is self).

Note: I’m on a development machine which is slow due to docker and everything. It’s quite possible that I’m in a race condition or something…?

---

_[View the full topic](https://meta.discourse.org/t/discourse-embed-fail-referer-mixed-up/201644)._
