Back to Content

StorageAccessHandle: locks property

files/en-us/web/api/storageaccesshandle/locks/index.md

latest904 B
Original Source

{{APIRef("Storage Access API")}}

The locks property of the {{domxref("StorageAccessHandle")}} interface returns an unpartitioned session {{domxref("LockManager")}} object if access was granted, and throws a SecurityError {{DOMxRef("DOMException")}} otherwise.

Value

A {{domxref("LockManager")}} object.

Examples

js
document.requestStorageAccess({ locks: true }).then(
  (handle) => {
    console.log("locks access granted");
    handle.locks.request("foo", (lock) => "ok");
  },
  () => {
    console.log("locks access denied");
  },
);

[!NOTE] See Using the Storage Access API for a more complete example.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also