W3cubDocs

/DOM

WindowOrWorkerGlobalScope.indexedDB

The indexedDB read-only property of the WindowOrWorkerGlobalScope mixin provides a mechanism for applications to asynchronously access the capabilities of indexed databases.

Syntax

var IDBFactory = self.indexedDB;

Value

An IDBFactory object.

Example

var db;
function openDB() {
 var DBOpenRequest = window.indexedDB.open('toDoList');
 DBOpenRequest.onsuccess = function(e) {
   db = DBOpenRequest.result;
 }
}

Specifications

Specification Status Comment
Indexed Database API 2.0
The definition of 'indexedDB' in that specification.
Recommendation Defined in a WindowOrWorkerGlobalScope partial in the newest spec.
Indexed Database API
The definition of 'indexedDB' in that specification.
Recommendation Initial definition.

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 24
24
23
Prefixed
Prefixed Requires the vendor prefix: webkit
Yes 16
16
10
Prefixed
Prefixed Requires the vendor prefix: moz
52
indexedDB now defined on WindowOrWorkerGlobalScope mixin.
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 ? Yes 22
22
52
indexedDB now defined on WindowOrWorkerGlobalScope mixin.
22 8 ?
Available in workers Yes ? Yes 37 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/WindowOrWorkerGlobalScope/indexedDB