Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

175
Views
Saving Local Application Settings

Is there any way to safely retain/save data (settings) other than IndexedDB and manual saving (prompt the user with a dialog box to save)?

Basically I am writing an offline application and will be bundled and deployed as a local html file (e.g. file:///D:/test/index.html, no servers, just run by double-clicking the html file). It will have some settings and I need to be able to save these settings locally. The first time the app boots up, I retrieve the settings from a app-settings.json file and save it to IndexedDB.

However, my problem is that when the user clears the browser data, the settings will be deleted as well.

I do not want to prompt the user with a dialog box asking to save the app-settings.json everytime an update is made to the settings. (It would also be prone to duplicate, misplaced settings)

Any suggestion on how to go about this? How can I safely retain the application settings without any servers? Maybe there is an offline database of some sort that can be used in scenarios like this?

Would appreciate any help here! I'm desperately out of ideas :(

Thank you!

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

// Check if site's storage has been marked as persistent
if (navigator.storage && navigator.storage.persist) {
  const isPersisted = await navigator.storage.persisted();
  console.log(`Persisted storage granted: ${isPersisted}`);
}

please enable persistent storage by enabling navigator.storage.persist, and I would suggest start using service workers to manage offline applications.

https://web.dev/persistent-storage/ https://developers.google.com/web/fundamentals/primers/service-workers

about 4 years ago · Juan Pablo Isaza Report

0

You Can use the Use the Javascript File Api https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API

The dialog to save the file will be shown once, Then reading the file will not require a file dialog.

BTW

VS Code web also uses the api: https://vscode.dev/

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!