W3cubDocs

/Web APIs

indexedDB global property

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

Value

An IDBFactory object.

Examples

The following code creates a request for a database to be opened asynchronously, after which the database is opened when the request's onsuccess handler is fired:

js

let db;
function openDB() {
  const DBOpenRequest = window.indexedDB.open("toDoList");
  DBOpenRequest.onsuccess = (e) => {
    db = DBOpenRequest.result;
  };
}

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
indexedDB 24 12 1610 10 15 8 4.4 25 22 14 8 1.5
worker_support 24 12 37 10 15 10 4.4 25 37 14 10 1.5

See also

© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/indexedDB