Storage Access API
[!NOTE] See StorageManager.estimate() to understand usage.
Syntax
estimate()
Parameters
None.
Return value
A Promise that fulfills with an unpartitioned StorageManager.estimate() object.
Exceptions
SecurityErrorDomException- : Thrown if access was not granted.
See StorageManager.estimate()
Examples
document.requestStorageAccess({ estimate: true }).then(
async (handle) => {
console.log("estimate access granted");
await handle.estimate();
},
() => {
console.log("estimate 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。离线整理了版式、链接和媒体显示。
