IDBFactory: databases() method
The databases
method of the IDBFactory
interface returns a list representing all the available databases, including their names and versions.
Note: This method is introduced in a draft of a specifications and browser compatibility is limited.
Syntax
Parameters
The method does not take in any parameters.
Return value
A promise that resolves either to an error or a list of dictionaries, each with two elements, name
and version
:
-
name
-
The database name.
-
version
-
The database version.
Exceptions
SecurityError
DOMException
-
Thrown if the method is called from an opaque origin.
Examples
const promise = indexedDB.databases();
promise.then((databases) => {
console.log(databases);
});
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 |
databases |
72 |
79 |
No |
No |
60 |
14 |
72 |
72 |
No |
51 |
14 |
11.0 |
See also