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

101
Visualizações
List all `navigator.storage` files / Clear storage cache

I store multiple large assets in navigator.storage, to avoid large downloads.

With it, I would like to do the following as well:

  1. "List" - to show all the saved files
  2. "Clear cache" - to delete all files saved to navigator.storage

I could not find a method to perform either.

Alternatives attempted

I have attempted to store the files directory in localStorage, however, this information can be cleared without the files being removed, and the user ends up with inflated storage use for unknown documents.

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

With localStorage you can easily add and remove datas:

function addToStorage() {
  localStorage.setItem('bgcolor', 'red');
  localStorage.setItem('font', 'Helvetica');
  localStorage.setItem('image', 'mydog.png');
}

function clearStorage() {
  localStorage.clear();
}

function removeStorageItem(item) {
  localStorage.removeItem(item);

}

addToStorage();
removeStorageItem('image');
clearStorage();
about 4 years ago · Santiago Trujillo Relatório

0

navigator.storage is not a storage location, which your question seems to imply. Rather, it is a storage manager that you can use to request that data be persisted, using navigator.storage.persist(). That method will persist data in the following stores:

  • Cache API
  • Cookies
  • DOM Storage (Local Storage)
  • File System API (browser-provided and sandboxed file system)
  • IndexedDB
  • Service workers

See the "Persistent Storage" article on web.dev for more info.

about 4 years ago · Santiago Trujillo Relatório
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