interface BroadcastChannel
implements EventTarget

Properties

readonly
name: string
[src]

Returns the channel name (as passed to the constructor).

onmessage: ((this: BroadcastChannel, ev: MessageEvent) => any) | null[src]
onmessageerror: ((this: BroadcastChannel, ev: MessageEvent) => any) | null[src]

Methods

close(): void[src]

Closes the BroadcastChannel object, opening it up to garbage collection.

postMessage(message: any): void[src]

Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.

addEventListener<K extends keyof BroadcastChannelEventMap>(
type: K,
listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any,
options?: boolean | AddEventListenerOptions,
): void
[src]
addEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | AddEventListenerOptions,
): void
[src]
removeEventListener<K extends keyof BroadcastChannelEventMap>(
type: K,
listener: (this: BroadcastChannel, ev: BroadcastChannelEventMap[K]) => any,
options?: boolean | EventListenerOptions,
): void
[src]
removeEventListener(
type: string,
listener: EventListenerOrEventListenerObject,
options?: boolean | EventListenerOptions,
): void
[src]
variable BroadcastChannel
{ prototype: BroadcastChannel; new (name: string): BroadcastChannel; }[src]