Well, I'm trying to run an iframe or window.open in my subdomain page to access the domain page for Google Login permission purposes. But i'm getting the cross origin error.
My principal page is: http://subdomain.lvh.me:3000
And when I click on the button, a new pages open or the iframe opens (does not make difference) with the URL: http://lvh.me:3000
But in this way I can't access iframe.contentWindow.document to get the iframe content value from the principal page. That is the situation: Image error
And, when I try to send by window.postMessage, this is the error: postMessage error
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://subdomin.lvh.me:3001') does not match the recipient window's origin ('http://lvh.me:3001').
You need to set the targetOrigin field when using postMessage to another domain
postMessage(‘hello world’, ’http://lvh.me:3000/’)