Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.product.cafe') does not match the recipient window's origin #86

Closed
AndreasGalster opened this issue Aug 30, 2017 · 5 comments

Comments

@AndreasGalster
Copy link

When trying out https://www.product.cafe on render-tron.appspot.com I get the following error:

Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.product.cafe') does not match the recipient window's origin ('http://render-tron.appspot.com').
ha @ 0sTQzbapM8j.js?version=42:53

You can see the error here: http://render-tron.appspot.com/render/https://www.product.cafe?wc-inject-shadydom=true

@samuelli
Copy link
Contributor

The provided render-tron sample endpoint is designed to allow you to test out how your page would look. In this case, we are rendering content that would otherwise a) be served via your domain and b) would only be served to bots that explicitly don't render.

In this example, as we're displaying the contents directly from the render-tron endpoint, you're seeing errors regarding cross origin security policies. See CORS page for more info on that.

Are you using an iframe somewhere?

@AndreasGalster
Copy link
Author

Does this mean our own rendertron service should be on the same domain (subdomain)? Yes, there's definitely iframes there, at least Intercom and Facebook. I think it's coming from FB.

@samuelli
Copy link
Contributor

Have you seen the Youtube video of me explaining this?

The approach is to proxy some of the requests through to Rendertron, but it will still be served directly from your server. This is essential to ensuring bots and crawlers 'see your page'. So you don't have to use your own Rendertron, or serve it on your own domain, but you'd need to add the middleware to proxy the request via Rendertron from within your server.

Does that make sense?

@AndreasGalster
Copy link
Author

Yes that makes sense, I was just not sure. I've been testing the middleware via your appspot deployment and didn't see the results I expected, so I was concerned.

I guess I just need to stop using the appspot version and wait for a day to get the cached results via the middleware :).

@samuelli
Copy link
Contributor

samuelli commented Sep 1, 2017

Closing this issue. Feel free to reopen/open a new issue if you encounter more problems.

@samuelli samuelli closed this as completed Sep 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants