StorageAccessHandle: BroadcastChannel() property

Note: See BroadcastChannel() to understand usage.

Syntax

js
handle.BroadcastChannel(channelName)

Parameters

Return value

An unpartitioned BroadcastChannel object.

Exceptions

SecurityError DomException

Thrown if access was not granted.

See BroadcastChannel()

Examples

js
document.requestStorageAccess({ BroadcastChannel: true }).then(
  (handle) => {
    console.log("BroadcastChannel access granted");
    handle.BroadcastChannel(channel_name);
  },
  () => {
    console.log("BroadcastChannel access denied");
  },
);

Note: See Using the Storage Access API for a more complete example.

Specifications

Specification
Extending Storage Access API (SAA) to non-cookie storage
# ref-for-dom-storageaccesshandle-broadcastchannel

Browser compatibility

BCD tables only load in the browser

See also