Hacker News new | ask | show | jobs
by judah 2173 days ago
> "Imagine a text editor where all your text documents are gone after you cleared the browser data"

One way to address that issue is the native file system access APIs[0] coming soon, available today in Chrome Canary and Edge Canary. There, you'd be able to save your documents to the user's file system, just like a native app would. Those files will be exempt from any browser data clearing.

> all infos about which exercises you did and when is gone for good of course.

Might be good to store that data on the server. I realize not all PWAs have a proper backend server, but that sounds like a good candidate.

[0]: https://bugs.chromium.org/p/chromium/issues/detail?id=853326

4 comments

> Native File System API

Great, so there is light at the end of the tunnel!

> store that data on the server

Well, we talked about that already:

https://news.ycombinator.com/item?id=23793541

I wonder how Mozilla will handle this, given that so far they deemed file system access as too dangerous even for extensions, nevermind random web pages…
They will kill it as they did the same to the two previous versions of the same thing...
> native file system access APIs[0]

Come on, stop giving people false hope, that API is like 3rd incarnation of the same thing by Google, always shot down by Mozilla and Apple. Even today if you restrict yourself to Chrome your PWA can use the older version of the same thing, but what's the point if that works only in Chrome?

Also, as mentioned elsewhere in this thread, you may also be interested in the Persistent Storage APIs: https://web.dev/persistent-storage/
From how I read it, this reduces the probability that the data gets deleted due to low disk space / garbage collection:

    Persistent storage can help protect
    critical data from eviction, and
    educe the chance of data loss.
Are you sure this keeps the data when the user deletes their browser data? To me it sounds like it does not:

    Persistent storage is not deleted by the browser,
    even if storage is running low. It will only be
    deleted if the user chooses to remove it via
    their site settings.
> There, you'd be able to save your documents to the user's file system, just like a native app would

What could possibly go wrong with that?