Storage & Files

Origin Private File System

Probing…

Origin Private File System is a web platform capability in the Storage & Files category. A private, origin-scoped filesystem with fast synchronous access from workers. Supported in Chromium 86+, Firefox 111+, and Safari 15.2+. Requires a secure context (HTTPS or localhost).

Secure context

Try it

Loading demo…

Code

const root = await navigator.storage.getDirectory()

const handle = await root.getFileHandle('demo.txt', { create: true })
const writable = await handle.createWritable()
await writable.write('Hello OPFS')
await writable.close()

const file = await (await root.getFileHandle('demo.txt')).getFile()
console.log(await file.text(), file.size)

Browser support

Chromium
86
Firefox
111
Safari
15.2

Frequently asked questions

Which browsers support Origin Private File System?

Supported in Chromium 86+, Firefox 111+, and Safari 15.2+.

Does Origin Private File System require HTTPS?

Yes. Origin Private File System needs a secure context, so it only works over HTTPS (or on localhost during development).

What is Origin Private File System used for?

A private, origin-scoped filesystem with fast synchronous access from workers.

Can I try Origin Private File System in my browser?

Yes. shwcs.net runs a live Origin Private File System demo that probes your current browser and lets you try the API. Everything runs locally — nothing is sent anywhere.

MDN reference ↗ Specification ↗ caniuse ↗