StorageAccessHandle: thuộc tính indexedDB
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Thuộc tính indexedDB của giao diện StorageAccessHandle trả về một đối tượng IDBFactory không phân vùng nếu quyền truy cập được cấp, và ném ra SecurityError DOMException trong trường hợp khác.
Giá trị
Một đối tượng IDBFactory.
Ví dụ
js
document.requestStorageAccess({ indexedDB: true }).then(
(handle) => {
console.log("indexedDB access granted");
await handle.indexedDB.deleteDatabase("foo");
},
() => {
console.log("indexedDB access denied");
},
);
Note: Xem Using the Storage Access API để biết ví dụ đầy đủ hơn.
Thông số kỹ thuật
| Specification |
|---|
| Extending Storage Access API (SAA) to non-cookie storage> # dom-storageaccesshandle-indexeddb> |