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

131
Vistas
Adding multiple local storage for same site

enter image description here

  • Under the 'Application' tab of chrome I've found there are multiple localstorage (please see the yellow box) like - https://stackoverflow.com , https://www.google.com etc.
  • I'm now in stackoverflow (#1)
  • I'm trying to add a new local storage by the name https://mytestdomain.com so I can see it in the yellow box
  • I've tried the following javascript code to achieve this
var testObject = { 'one': 1, 'two': 2, 'three': 3 };  
localStorage.setItem('https://mytestdomain.com', JSON.stringify(testObject));
  • but it always gets added under the localstorage - https://stackoverflow.com (#2, #3). It's not being added as a new localStorage

Can anyone help me here?

Thanks in advance.

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

0

That yellow box in the image represents all the sites which are storing some data in your localstorage. You cannot add a sitename (i.e https://mytestdomain.com) using localstorage.setItem().

Using localstorage.setItem('key', 'val') only set value in current domain's local Storage

If you want some value under https://mytestdomain.com domain, there should be a site with url - https://mytestdomain.com storing something in your localstorage.

Check here in the official doc for more info - Documentation Link

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