Important: As of Firefox 52, the property defined in this mixin has been moved to the WindowOrWorkerGlobalScope
mixin, and other browsers will follow suit. Look to that page for up-to-date details.
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.
IDBEnvironment.indexedDB
Read only
IDBFactory
object.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; }; }
Specification | Status | Comment |
---|---|---|
Indexed Database API The definition of 'IDBEnvironment' in that specification. | Recommendation |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 24
|
Yes | 16
|
10
|
15 | 7 |
Available in workers | Yes | Yes | 37 | ? | Yes | ? |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | 25 | ? | 22 | 22 | 8 | Yes |
Available in workers | Yes | Yes | Yes | 37 | Yes | ? | Yes |
IDBDatabase
IDBTransaction
IDBKeyRange
IDBObjectStore
IDBCursor
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/IDBEnvironment