Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

110
Views
Build communications between tabs

I am trying to create a communication channel between tabs. In my main tab I have the following:

window.addEventListener("message", (event) => {
   console.log(event.data);
}, false);

I am opening new tab using this code:

window.open('https://localhost/newtab.html', '_blank');

In the newtab.html I hav this code:

<html>
  <body>
    <script>
        window.postMessage('message', 'abc');
    </script>
  </body>
</html>

Both target tab and new tab are on the same domain. I am not getting into target tab when opening a new tab. What am I missing?

Thanks

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!