Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

211
Vistas
Browser tab knows when it has been duplicated

I want my browser tab to know when it has been duplicated.

The only similar solutions I've seen focus on just the duplicated tab knowing it's been duplicated or the original tab knowing it's been duplicated but this only works on Chrome.

Requirements:

  • Solution works on all modern browsers

Bonus if the solution:

  • Works on a version of Internet Explorer
  • Uses some native Angular functionality
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can make use of Broadcast Channel API .

  1. Create a channel on load and broadcast the message
  2. use the onmessage event, capture the message and if it matches the initial one, broadcast another
  3. The duplicate tag will receive the second broadcast , while first tab receives the first broadcast

 const broadcast = new BroadcastChannel('test')
    broadcast.postMessage('I am First');
    broadcast.onmessage = (event) => {
      if (event.data === "I am First") {
        broadcast.postMessage(`Sorry! Already open`);
        alert("First Tab");
      }
      if (event.data === `Sorry! Already open`) {
        alert("Duplicate Tab");
      }
    };

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda