4 ms·
I'm sorry? I did, and I just skimmed over it again, and I still don't see where it says anything along the lines of "even when searching for the contents". The
by drdaeman 2y ago
I'm sorry? I did, and I just skimmed over it again, and I still don't see where it says anything along the lines of "even when searching for the contents".
The only relevant piece I see in the article is this (emphasis mine):
> Browsers persist the contents of the OPFS to disk somewhere, but you cannot expect to find the created files matched one-to-one. The OPFS is not intended to be visible to the user.
And that matches how cookies and localStorage works. They aren't files either, they're in a SQLite database somewhere out there.
Can you please give me a quote where it says so?
Upd: There's Chrome (web.dev) article linked from MDN that explicitly mentions a way for end-user to browse this filesystem: https://web.dev/articles/origin-private-file-system#debug_the_origin_private_file_system https://web.dev/articles/origin-private-file-system#debug_th... - I'm pretty sure Firefox has (or will have, idk how mature is this standard) something similar.
How those files are stored on disk is an implementation detail. All article says that user should not expect them to match their local filesystem conventions, hinting that it's probably going to live in some kind of a database rather than match host filesystem conventions.
Upd2: I've checked out the demo (https://sqlite-wasm-opfs.glitch.me/ https://sqlite-wasm-opfs.glitch.me/) and it looks like, indeed, Firefox is missing an ability to introspect the storage at the moment. Or at least I don't see anything in DevTools on Firefox 131. This is disappointing and concerning, but I strongly suspect it's a bug/missing feature rather than a deliberate design decision.
Upd3: I see that demo's site data near-pristine content-wise under ~/.mozilla/firefox/$profile/storage/default/https+++sqlite-wasm-opfs.glitch.me/fs/... While filenames are nonsensical, the SQLite3 demo database (with that single table "t") that's created in OPFS is accessible in my host machine's filesystem verbatim:
$ sqlite3 KF3XI6X7GVF3O6IT3QGODMSZ4OMH56DTTUBOK23MNTB6ODM5HWEA
SQLite version 3.45.3 2024-04-15 13:34:05
Enter ".help" for usage hints.
sqlite> .tables
t
sqlite> SELECT * FROM t LIMIT 3;
20|40
21|42
22|44
- TheRealPomax 2y agoNote that if it shows up in the dev tools "Storage" tab, then that's fine, that's how you audit cookies and local/sessionStorage just fine already. But from what I can tell, part of the "no no, we call it private for a reason" is that they're not getting exposed that way. If finding a sqlite3 db and manually working in that is the only way to audit the data, that's a dark pattern right there. I'd be happy to be wrong about that, though.
- drdaeman 2y agoFor some reason it's not visible in DevTools' "Storage" tab (Firefox 131.0.2). I strongly suspect it's negligence rather than malice, though.
- TheRealPomax 2y agoProbably because this spec hasn't been accepted yet, it's still a draft.