W3cubDocs

/Web APIs

Window: indexedDB property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

The indexedDB read-only property of the Window interface 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:

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

Specifications

Browser compatibility

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

See also

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