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

111
Visualizações
close different browser tabs from one application

I have 2 applications where App2 is accessible when we click on a link in App1. Each time this link is clicked, a new browser tab is opened containing App2.

Now I have a requirement where upon logout of App1, all the instances (tabs) opened for App2 should be closed.

I tried capturing window objects of App2. And thought of using winObj.close() to close each one of them with a loop. But the problem is that how and where can I capture window Objects ? (I need to get those objects when user clicks on logout).

I tried in cookie and localStorage by using localStorage.setItem('app2Window', JSON.stringify(window)) but JSON.stringify(window) gives me following error:

Uncaught TypeError: Converting circular structure to JSON --> starting at object with constructor 'Window' --- property 'window' closes the circle at JSON.stringify () at :1:41

Any help/pointers towards this problem will be appreciated.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Looks like the BroadcastChannel is what you're looking for:

  • https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API
  • https://developer.chrome.com/blog/broadcastchannel/ it's main purpose is for one-to-many communication between scripts on the same origin.
about 4 years ago · Juan Pablo Isaza Relatório
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