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

144
Vistas
Retain state on new tab, but not page refresh

I am trying to have a JS state that is retained when user opens a new tab (or new window), but is not retained on explicit page refresh. Is that possible in JS ?

So I am trying to somehow achieve reverse of what sessionStorage can give which states as per MDN docs; Opening a page in a new tab or window creates a new session with the value of the top-level browsing context, which differs from how session cookies work.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Sounds like you could keep the state in local storage. When the page is loaded, check if a session storage value exists - if so, don't retrieve the data from local storage. Otherwise, if the session storage value doesn't exist, it's a new page, in which case you can retrieve the state from local storage.

Regardless, whenever a page is loaded, set a session storage value so it can be read later by the above logic, in case the page gets refreshed.

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