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

169
Vistas
Javascript: assign the popup tab as a variable

I have two domains on different hostings, domain A is the main website, domain B is the authorization server with simple frontend. I have very strict security policy applied, which forces the users after 1 hour to re-authorize themselves. It's done by popup window in new tab, calling domain B from the frontend of the domain A. I realized that the popup blocking policy and the fact, that not every browser behave the same, i found the only solution to bring the popup correctly (in the new tab) by this javascript call (when the timer reaches 60mins):

Object.assign(document.createElement('a'), { target: '_blank', href: 'https://domain_B/auth.php'}).click();

My problem is, that i am unable to check from the domain A, if the popup window is opened correctly and the user haven't closed it. So i need to assign a variable to the new popup tab and check if it's still available, otherwise i need to re-open it from the domain A.

So i want to do something like this:

 if(popup_win && !popup_win.closed)
  { //do my auth stuff 
   }

the problem is, that i am unable to assign the new popup to popup_win javascript variable. I can do it by calling a single window.open(url,"_blank") but as i mentioned above, the result then depends on popup-blockers and browser version/type.

Any help/suggestion appreciated!

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