Storage Access API
[!NOTE] See BroadcastChannel.BroadcastChannel to understand usage.
Syntax
BroadcastChannel(channelName)
Parameters
channelName- : See BroadcastChannel.BroadcastChannel.
Return value
An unpartitioned BroadcastChannel object.
Exceptions
SecurityErrorDomException- : Thrown if access was not granted.
See BroadcastChannel.BroadcastChannel
Examples
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
Browser compatibility
See also
- Document.requestStorageAccess()
- Using the Storage Access API
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
