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

124
Vistas
Mobile safari local storage doesn't appear on simulator

I'm running an iPhone simulator, pointing safari there to html/js in the file system, like file:///Users/me/Desktop/.... The app runs fine, except I'm finding it impossible to use localStorage. The following has the following effect:

html includes js, and js says:

alert('test');  ---> alert appears: test
alert(window);  ---> alert appears: [Object object]
alert(Object.keys(window).filter(k => k === 'localStorage'))  ---> alert appears: localStorage

But the next alert doesn't even appear, nor does the one following it.

alert(window.localStorage); ---> No alert appears
alert('did we make it here?');  ---> No alert appears

I've googled a bunch and found issues relating to localStorage expiring, and localStorage not working in iframes, but my problem is that it seems to be undefined (worse than undefined, even mentioning localStorage gets the app lost).

EDIT I setup a server and found that the problem is not present when the app is served, rather than read from the file system. This can be a work-around, but I'd still like to understand what's wrong using the file system and how I could possibly debug both ways.

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