Web/API/IDBEnvironment

From Get docs

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

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

IDBEnvironment

Deprecated'Non-standard'

Chrome Full support 24


Full support 24


No support 23 — 57

Prefixed'

Prefixed' Implemented with the vendor prefix: webkit

Edge

Full support 12

Firefox Full support 16


Full support 16


No support 10 — 16

Prefixed'

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

Deprecated'Non-standard'

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