The indexedDB read-only property of the WindowOrWorkerGlobalScope mixin provides a mechanism for applications to asynchronously access the capabilities of indexed databases.
Syntax
var IDBFactory = self.indexedDB;
Value
An IDBFactory object.
Example
var db;
function openDB() {
var DBOpenRequest = window.indexedDB.open('toDoList');
DBOpenRequest.onsuccess = function(e) {
db = DBOpenRequest.result;
}
}
Specifications
| Specification | Status | Comment |
|---|---|---|
| Indexed Database API 2.0 The definition of 'indexedDB' in that specification. |
Recommendation | Defined in a WindowOrWorkerGlobalScope partial in the newest spec. |
| Indexed Database API The definition of 'indexedDB' in that specification. |
Recommendation | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
| Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|---|
| Basic support | 24 23 webkit | Yes | 16 10 moz 521 | 10 | 15 | 7 |
| Available in workers | Yes | Yes | 37 | ? | Yes | ? |
| Feature | Android webview | Chrome for Android | Edge mobile | Firefox for Android | Opera Android | iOS Safari | Samsung Internet |
|---|---|---|---|---|---|---|---|
| Basic support | Yes | ? | Yes | 22 521 | 22 | 8 | ? |
| Available in workers | Yes | ? | Yes | 37 | Yes | ? | ? |
1. indexedDB now defined on WindowOrWorkerGlobalScope mixin.
See also
- Using IndexedDB
- Starting transactions:
IDBDatabase - Using transactions:
IDBTransaction - Setting a range of keys:
IDBKeyRange - Retrieving and making changes to your data:
IDBObjectStore - Using cursors:
IDBCursor - Reference example: To-do Notifications (view example live.)