This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
Note: This feature is only available in Web Workers.
The indexedDB read-only property of the WorkerGlobalScope interface provides a mechanism for workers to asynchronously access the capabilities of indexed databases.
An IDBFactory object.
The following code creates a request for a database to be opened asynchronously, after which the database is opened when the request's onsuccess handler is fired:
let db;
function openDB() {
const DBOpenRequest = self.indexedDB.open("toDoList");
DBOpenRequest.onsuccess = (e) => {
db = DBOpenRequest.result;
};
}
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
indexedDB |
24 | 12 | 1610 | 15 | 8 | 25 | 22 | 14 | 8 | 1.5 | 4.4 | 8 |
worker_support |
24 | 12 | 37 | 15 | 10 | 25 | 37 | 14 | 10 | 1.5 | 4.4 | 10 |
IDBDatabase
IDBTransaction
IDBKeyRange
IDBObjectStore
IDBCursor
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WorkerGlobalScope/indexedDB