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

132
Vistas
Javascript window.confirm doesn't work if focus isn't on tab?

My code is extremely simple:

const response = confirm("Message");
console.log('done');

Edit: it turns out it has nothing to do with dev tools - it's whether my focus is on that tab or on a different one.


If I have the dev tools closed, the confirm modal simply does not appear and it skips straight to printing done. I have the dev tools open, the confirm modal appears.

I am kinda lost on this one, am I missing something here? If I just write setTimeout(() => { confirm() }, 3000) in the dev tools of a random tab and then close the dev tools, then the confirm still appears there. But with the actual code running on my page...nothing.

Edit - it may be that it only appears if my focus is on the page in question? Is there a rule around that?

about 4 years ago · Juan Pablo Isaza
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