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
SecurityErrorDomException- : 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
- Document.requestStorageAccess()
- Using the Storage Access API
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
