Intent to prototype & ship: Origin Private File System API (OPFS)

Skip to first unread message

Randell Jesup

Nov 10, 2022, 11:40:43 AM11/10/22

Summary: The Origin Private File System (hereafter referred to as OPFS) API allows for file access to an origin-specific set of files.   Unlike other storage APIs, OPFS allows for direct file access from content with high performance, which enables (among other things) WASM applications that require performant File IO to work in a browser.  OPFS data is subject to normal storage quota limits, and may be deleted if needed by the browser.

Unlike other File Access APIs proposed over the years, OPFS restricts access to data written by the same origin, within a sandbox in the user's profile.   This provides far more security and privacy than previous proposals.   There is no ability to read or write user files elsewhere in the filesystem.

As of mid-November 2022, we intend to turn OPFS on by default on all platforms in Nightly, and we expect it to ride the trains to release. It has been developed behind the dom.fs.enabled preference. Status in other browsers is shipping in Chrome since 101, and in Safari starting in MacOS 12.2+ and iOS 15.2+ (i.e. Safari 15.2+).

Tracking bug: Bug 1748667

Bug to enable by default: 1785123

Standard: OPFS standard -- Note, several relevant parts of the spec we and all others have implemented are waiting to merge, especially PRs 21 (syncAccessHandle) and 10 (move)

Platforms: All.   Disabled (for now) in Private Browsing mode.

Preference: dom.fs.enabled

Devtools Bug: Bug 1795516

Other browsers:

Chrome: shipping by default since 101 (origin trials before that)

Safari: Shipping since Safari 15.2/macOS 12.2.  (getFile() support in 15.4+/12.4)



Randell Jesup, Mozilla

Reply all
Reply to author
0 new messages