MDN self-hosted library · e01.org

StorageAccessHandle: getDirectory() method

Storage Access API

Storage Access API

[!NOTE] See StorageManager.getDirectory() to understand usage.

Syntax

getDirectory()

Parameters

None.

Return value

A Promise that fulfills with an unpartitioned FileSystemDirectoryHandle object.

Exceptions

  • SecurityError DomException
  • : Thrown if access was not granted.

See StorageManager.getDirectory()

Examples

document.requestStorageAccess({ getDirectory: true }).then(
  async (handle) => {
    console.log("getDirectory access granted");
    await handle.getDirectory();
  },
  () => {
    console.log("getDirectory access denied");
  },
);

[!NOTE] See Using the Storage Access API for a more complete example.

Specifications

Browser compatibility

See also