arj03 / ssb-browser-demo

A secure scuttlebutt client interface running in the browser
Other
58 stars 11 forks source link

Long-term persistent storage in Firefox #216

Closed KyleMaas closed 3 years ago

KyleMaas commented 3 years ago

In Chromium, when I first launch ssb-browser-demo, it pops up a box asking if I want to let it persist storage. Firefox does not ask. I have not tried a long-running instance of ssb-browser-demo under Firefox with enough data to trigger eviction, but I'm wondering if we need to run:

https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/persist

Because this says we would need to to avoid eviction:

https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Browser_storage_limits_and_eviction_criteria

KyleMaas commented 3 years ago

Evidently, the request for file storage in Chromium comes from here:

https://github.com/random-access-storage/random-access-chrome-file/blob/8f02ac6601ffd085f1d4760c0f76a382ea3b69d6/index.js#L18

But in Firefox, RAF is handled by random-access-idb-mutable-file:

https://github.com/random-access-storage/random-access-idb-mutable-file/blob/master/src/random-access-idb-mutable-file.js

...which doesn't use navigator.storage and thus is unlikely to need to ask permission. As such, I'm going to go ahead and close this.