currently I've this code to post a message to the parent window:
const onSomething = () => {
window.parent.postMessage('hey', 'https://www.google.com')
}
And inside the parent window, I'm accessing the document and send some data back to the iframe.
My question is, can I access the window parent document inside my application(A.K.A the iframe) or only the parent window can access his document?
If I'm calling window.parent.document from my application I'm getting this error:
SecurityError: Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.
NOTE: The parent window and the iframe are different origins