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.

Note: This feature is available in Web Workers.

Properties

IDBEnvironment.indexedDB Read only
Provides a mechanism for applications to asynchronously access capabilities of indexed databases; contains an IDBFactory object.

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;
 };
}

Specifications

Specification Status Comment
Indexed Database API
The definition of 'IDBEnvironment' in that specification.
Recommendation  

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support 24
Full support 24
No support 23 — 57
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support YesFirefox Full support 16
Full support 16
No support 10 — 16
Prefixed
Prefixed Implemented with the vendor prefix: moz
IE Full support 10
Notes
Full support 10
Notes
Notes partial
Opera Full support 15Safari Full support 7WebView Android Full support YesChrome Android Full support 25Edge Mobile ? Firefox Android Full support 22Opera Android Full support 22Safari iOS Full support 8Samsung Internet Android Full support Yes
Available in workersChrome Full support YesEdge Full support YesFirefox Full support 37IE ? Opera Full support YesSafari ? WebView Android Full support YesChrome Android Full support YesEdge Mobile Full support YesFirefox Android Full support 37Opera Android Full support YesSafari iOS ? Samsung Internet Android Full support Yes

Legend

Full support  
Full support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

See also