The File System API with Origin Private File System
WebKit now supports the File System Standard's origin private file system, a per-origin sandboxed storage area where web apps can create, read, write, move, enumerate and delete files and directories. It is available from Safari on macOS 12.2 and iOS 15.2, has the same lifetime as IndexedDB and localStorage, and is disabled in Private Browsing. Worked examples cover navigator.storage.getDirectory(), getFileHandle/getDirectoryHandle, move(), resolve(), async iteration, removeEntry() and getFile(). Writing in WebKit currently requires FileSystemSyncAccessHandle, which works only in Workers, takes exclusive access to a file, and offers synchronous read, write, truncate and flush for the best performance.
Related posts
- Building Profiles with new WebKit API
WebKit mediumAdeptmacOS 14 and iOS 17 add WebKit APIs for creating multiple persistent WKWebsiteDataStore instances, each keyed by a UUID, so apps can build browser-style profiles with separate cookies and website data. Assign a store to a WKWebView through its configuration, remove it with WKWebsiteDataStore.remove(forIdentifier:), which can fail if the store is in use or the file system errors, and list existing stores via allDataStoreIdentifiers to avoid creating one by accident. App-owned data such as bookmarks, history and per-site settings still has to be separated per profile by the client.
- Supabase Storage now in Beta
Supabase mediumAdeptSupabase Storage moves to Beta with range-request streaming for audio/video, whole-bucket public visibility (private by default, to avoid S3-style per-object exposure), directory uploads via the File and Directory Entries API, an RLS policy editor with SQL templates, and a local-filesystem backend so self-hosted setups need no S3. To keep supabase-js small and universal without a FormData polyfill or separate Node/browser bundles, the server now accepts raw binary bodies, letting clients upload Buffers, Blobs and Node streams. The dashboard emulates filesystem semantics on S3: move becomes copy-then-delete, and placeholder files keep empty directories from disappearing. Upsert support and list virtualization for large buckets are also added.
- Experimenting with the proposed Cross-Origin Storage API in Transformers.js
Hugging Face mediumAdeptBrowser cache partitioning (in Chrome, keying by Network Isolation Key plus URL) forces every origin running Transformers.js to re-download identical model weights and the ONNX Runtime Wasm file. In the toy example that duplication costs 177 MB for Whisper alone. The proposed Cross-Origin Storage API (navigator.crossOriginStorage) fixes this by addressing files by SHA-256 hash instead of URL, with an OPFS-like getFileHandle interface. It also verifies hashes on write and lets developers scope visibility via an origins list that can be widened but never narrowed. Privacy is handled through availability gating for rarely seen resources, so apps must treat any error as a cache miss. Transformers.js already ships an experimental opt-in COS backend via env.experimental_useCrossOriginStorage, testable today with a polyfill extension.
- Updates to Storage Policy
WebKit mediumAdeptStarting in Safari 17 and WebKit apps on iOS 17, iPadOS 17 and macOS Sonoma, storage quota is a percentage of disk space. Each origin can use up to 60% of the disk in browser apps and 15% in other apps, with an overall cap of 80% or 20%. Cross-origin frames get 10% of the main frame's quota, and Safari no longer prompts users for more space. When the overall quota is exceeded or the system is short on storage, WebKit evicts whole origins in least-recently-used order, skipping origins with active pages or persistent storage. The Storage API's estimate(), persisted() and persist() are now fully supported, but developers still need to handle QuotaExceededError.
- Improving the Storage Access API in Firefox
Mozilla Hacks mediumAdeptAhead of enabling State Partitioning for all users, Firefox is changing its Storage Access API implementation in four ways. Automatic storage grants now require recent user interaction with the third party, and accepted prompts or iframe interactions count as interaction. Permissions are scoped to the Site rather than the origin, which fixes login flows that move across subdomains. Interaction rules are tightened: denying a prompt clears the interaction, accepting resets its timer, and a reload requires new interaction. When third-party cookies are blocked, requestStorageAccess always rejects and hasStorageAccess returns false starting in Firefox 98.