StorageAccessHandle: phương thức estimate()

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Note: Xem StorageManager.estimate() để hiểu cách sử dụng.

Cú pháp

js
estimate()

Tham số

Không có.

Giá trị trả về

Một Promise được thực hiện với một đối tượng StorageEstimate không phân vùng.

Ngoại lệ

SecurityError DomException

Được ném ra nếu quyền truy cập không được cấp.

Xem StorageManager.estimate()

Ví dụ

js
document.requestStorageAccess({ estimate: true }).then(
  (handle) => {
    console.log("estimate access granted");
    await handle.estimate();
  },
  () => {
    console.log("estimate 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-estimate

Tương thích trình duyệt

Xem thêm