Properties Jump to heading
readonly
Jump to headingname: string
Returns the channel name (as passed to the constructor).
Jump to headingonmessage: ((this: BroadcastChannel,ev: MessageEvent,) => any) | null
Jump to headingonmessageerror: ((this: BroadcastChannel,ev: MessageEvent,) => any) | null
Methods Jump to heading
Jump to headingclose(): void
Closes the BroadcastChannel object, opening it up to garbage collection.
Jump to headingpostMessage(message: any): void
Sends the given message to other BroadcastChannel objects set up for this channel. Messages can be structured objects, e.g. nested objects and arrays.
Jump to headingaddEventListener<K extends keyof BroadcastChannelEventMap>(type: K,listener: (this: BroadcastChannel,ev: BroadcastChannelEventMap[K],) => any,options?: boolean | AddEventListenerOptions,): void
Jump to headingaddEventListener(type: string,listener: EventListenerOrEventListenerObject,options?: boolean | AddEventListenerOptions,): void
Jump to headingremoveEventListener<K extends keyof BroadcastChannelEventMap>(type: K,listener: (this: BroadcastChannel,ev: BroadcastChannelEventMap[K],) => any,options?: boolean | EventListenerOptions,): void