语法
js
estimate()
参数
无。
返回值
一个 Promise,它会解析为一个未分区的 StorageEstimate 对象。
异常
SecurityErrorDomException-
如果未授予访问权限,则抛出此异常。
示例
js
document.requestStorageAccess({ estimate: true }).then(
(handle) => {
console.log("estimate access granted");
await handle.estimate();
},
() => {
console.log("estimate access denied");
},
);
注意:有关更完整的示例,请参阅使用 Storage Access API。
规范
| 规范 |
|---|
| 将存储访问API(SAA)扩展到非Cookie存储 # dom-storageaccesshandle-estimate |
浏览器兼容性
加载中…