W3cubDocs

/DOM

IDBEnvironment

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

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 24
24
23 — 57
Prefixed
Prefixed Requires the vendor prefix: webkit
Yes 16
16
10 — 16
Prefixed
Prefixed Requires the vendor prefix: moz
10
10
partial
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

See also

© 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