Browser Compatibility
web-sqlite-js leverages modern browser APIs to provide high-performance, persistent SQLite storage. To use this library, the user's browser must support the following capabilities.
Minimum Browser Versions
Based on the combined requirements above (primarily restricted by OPFS and DecompressionStream), the following are the minimum recommended browser versions:
| Browser | Minimum Version | Note |
|---|---|---|
| Google Chrome | 102+ | Full support for OPFS and SAB. |
| Mozilla Firefox | 113+ | Required for DecompressionStream and OPFS. |
| Apple Safari | 17+ | Required for full OPFS support. |
| Microsoft Edge | 102+ | Same engine as Chrome. |
Important: Security Requirements
Even with a compatible browser, two critical security constraints must be met:
1. HTTPS Environment
Secure contexts are required for OPFS and SharedArrayBuffer. The library will not function over plain HTTP (except for localhost).
2. COOP/COEP Headers
To enable SharedArrayBuffer (which SQLite uses for file locking), your server must send the following HTTP headers:
Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corpWithout these headers, the browser will disable SharedArrayBuffer, and the library will throw an error. For setup instructions, see the Getting Started guide.
Required Web APIs
| Feature | Purpose | Minimum Requirement |
|---|---|---|
| OPFS | Persistent file storage on the user's device. | Chrome 102, Firefox 111, Safari 17 |
| WASM | Running the SQLite engine at near-native speed. | All modern browsers |
| SharedArrayBuffer | High-performance locking and concurrency. | Chrome 68, Firefox 79, Safari 15.2 |
| DecompressionStream | On-the-fly decompression of the SQLite WASM binary. | Chrome 80, Firefox 113, Safari 16.4 |
| Module Workers | Running logic in background threads via ES Modules. | Chrome 80, Firefox 114, Safari 15 |