i am trying to get the parents information(body,tags etc) and transfer the data to my iframe my iframe is a vue application running on localhost:3000
when trying to postMessage like this(or any other way)
let ifr = window.parent.querySelector("user1stframe").contentWindow;
ifr.postMessage("hello", "https://www.ikea.co.il/catalogue/Workspaces");
i get this error in the console : SecurityError: Blocked a frame with origin "http://localhost:3000" from accessing a cross-origin frame.
by the way , im embeding the iframe throug scripty chrome extension this way :
let frame = `
<iframe class="frame" src="http://localhost:3000/"></iframe>
<style>
.frame{
width:600px;
height:700px;
position:absolute;
top:0;
left:0;
z-index:100;
}
</style>
`
document.body.innerHTML += frame;
and its working can anyone help me with the error?