Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

119
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda