StorageAccessHandle: thuộc tính locks

Limited availability

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

Thuộc tính locks của giao diện StorageAccessHandle trả về một đối tượng LockManager phiên 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 LockManager.

Ví dụ

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

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

Xem thêm