I try to embedd Discourse in a web site on a complete other domain, e.g. https://doc.test.dom
I added embedding settings to Discourse.
In the JavaScript console I get always this error:
Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘https ://discourse.example.com’) does not match the recipient window’s origin (‘https ://doc.test.com’)
Any ideas?
I already tried to modify CORS settings in the Docker-Host-nginx.conf. No success.
Make sure that you created an embeddable host in Discourse for doc.test.com and that the URLs in the JavaScript you embedded are correct and, in your case, use HTTPS.
It would be easier to help if we knew the actual URLs of your site. And did you change the error message you posted in any way? Because there is a whitespace in the URLs (https ://discourse.example.com).
I had to add the white spaces in the error message because the platform did reject my post as a new user is only allowed to have only 2 URLs in a new post.
I added the url “doc.test.com” in the embedding settings of Discourse.
It works now! My last try was to edit the “discourseEmbedUrl” in JavaScript that need to be exact the referer URL / URL of the page where Discourse is embedded in.