Re: [whatwg/storage] Storage is available to the `file` scheme, contrary to the specification (Issue #195)

BrianJDrake left a comment (whatwg/storage#195)

To expand on the original issue description:

1. Recently, I had the opportunity to run some quick tests on Firefox, Chrome and Edge. (My own computer has only Firefox.) The information below was written from memory.

2. I checked the following in the `file` scheme and in `about:blank`, and confirmed that their behavior was different (success and failure, respectively), indicating that storage is indeed available to the `file` scheme:
    
    - `window.localStorage`
    - `window.sessionStorage`
    - `window.caches`
    - `window.indexedDB.databases()`

3. I confirmed that `location.origin === 'null'`, indicating that the `file` scheme does indeed use opaque origins.

4. I don’t know about opaque origins in general, but speaking specifically about the `file` scheme, I hope that storage does remain available (and that the standard is updated accordingly).

    I maintain a private web app for a small group of people, which includes ‘installing’ and updating this app (by copying it onto their local file systems); the users need only be concerned with opening this app (using a web browser bookmark). This setup needs to be:

    - Simple (both for me as a developer and for the users, who need to use web browsers anyway, and don’t necessarily use other native apps).
    - Private (not exposed to the network).
    - Robust (not subject to issues like web server crashes).
    
    The obvious choices are:

    - Implement this private app as a web app.
    - Have this private web app loaded from the local file system, rather than a web server.

    It works very well – except that it relies on this undocumented ability for the `file` scheme to access storage.

    I’m currently rewriting the whole app, including looking for a `localStorage` replacement to get around the 5 MiB limit, and it seems like a good idea to get to the bottom of these specification issues. Hopefully, it will end with all forms of storage remaining available to the `file` scheme.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/storage/issues/195#issuecomment-5976376711
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/storage/issues/195/5976376711@github.com>

Received on Sunday, 4 October 2026 04:04:05 UTC