filer
filer copied to clipboard
Make use of navigator.storage.* API
There are some new storage/quota APIs that might be useful for us to make use of with Filer:
-
navigator.storage.persist()
- to let the browser know we'd like to not have our db cleaned up automatically, andnavigator.storage.persisted()
to figure out if it has been. -
navigator.storage.estimate()
- to get usage and quota numbers for storage on this origin.
These APIs are async (promise based), and could be called when we mount the filesystem (needs to open the db, so it's async already). Extra info about how the data is persisting in the db, and size info could be added to the filesystem object we give back.
Related, we should probably do more to monitor and catch/report quota exceeded exceptions with the db. See https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria for details.