Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

112
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda