ObsoleteThis feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
Important: The indexedDB property that was previously defined in this mixin is instead now WindowOrWorkerGlobalScope.indexedDB (that is, defined as a member of the WindowOrWorkerGlobalScope mixin).
The IDBEnvironment helper of the IndexedDB API contains the indexedDB property, which provides access to IndexedDB functionality. It is the top level IndexedDB interface implemented by the window and Worker objects.
Note: This feature is available in Web Workers.
Properties
IDBEnvironment.indexedDBRead only- Provides a mechanism for applications to asynchronously access capabilities of indexed databases; contains an
IDBFactoryobject.
Example
The following code creates a request for a database to be opened asychronously, after which the database is opened when the request's onsuccess handler is fired:
var db;
function openDB() {
var DBOpenRequest = window.indexedDB.open("toDoList");
DBOpenRequest.onsuccess = function(e) {
db = DBOpenRequest.result;
};
}
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.
Update compatibility data on GitHub
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
Chrome Full support 24 Full support 24 No support 23 — 57 Prefixed' Implemented with the vendor prefix: webkit |
Edge
Full support 12 |
Firefox Full support 16 Full support 16 No support 10 — 16 Prefixed' Implemented with the vendor prefix: moz |
IE
Partial support 10 |
Opera
Full support 15 |
Safari
Full support 7 |
WebView Android
Full support Yes |
Chrome Android
Full support 25 |
Firefox Android
Full support 22 |
Opera Android
Full support 14 |
Safari iOS
Full support 8 |
Samsung Internet Android
Full support 1.5 |
|
Available in workers |
Chrome
Full support Yes |
Edge
Full support ≤18 |
Firefox
Full support 37 |
IE
? |
Opera
Full support Yes |
Safari
? |
WebView Android
Full support Yes |
Chrome Android
Full support Yes |
Firefox Android
Full support 37 |
Opera Android
Full support Yes |
Safari iOS
? |
Samsung Internet Android
Full support Yes |
Legend
- Full support
- Full support
- Partial support
- Partial support
- Compatibility unknown
- Compatibility unknown
- Non-standard. Expect poor cross-browser support.'
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.'
- Deprecated. Not for use in new websites.
- Requires a vendor prefix or different name for use.'
- Requires a vendor prefix or different name for use.
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 ([[../../../../../../mdn.github.io/to-do-notifications/index|view example live]].)
IDBEnvironment by Mozilla Contributors is licensed under CC-BY-SA 2.5.