Trying to access some website's HTML and transfer it to an popup IFRAME - but cannot get it

Viewed 32

i am trying to get a website's HTML doucument through iframe and google chrome extention which injects JS to the website i am able to pop up the window , but i cannt get the "parent" document - only the childs. this is the code i inject to the website :

   let msg = window.document;
let child_url = "https://localhost:3000"
function sendData(){
let ref=window.open(child_url,"pop","width=450,height=650,resizable=1");
  ref.postMessage('here i want to send the html document', 'https://www.ikea.co.il');
    
}
sendData();

this is the event listener in my index.html (this is a vue app)

<script>
  window.addEventListener("message", function(e) {
    console.log(e);
  });
</script>

somehow the console only logs the childs html document i added proxy server and they are both HTTPS Protocol

0 Answers
Related