BroadcastChannel

open external class BroadcastChannel(name: String) : EventTarget

Exposes the JavaScript BroadcastChannel to Kotlin

Constructors

BroadcastChannel
Link copied to clipboard
fun BroadcastChannel(name: String)

Functions

addEventListener
Link copied to clipboard
fun addEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun addEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)
close
Link copied to clipboard
fun close()
dispatchEvent
Link copied to clipboard
fun dispatchEvent(event: Event): Boolean
postMessage
Link copied to clipboard
fun postMessage(message: Any?)
removeEventListener
Link copied to clipboard
fun removeEventListener(type: String, callback: (Event) -> Unit?, options: dynamic = definedExternally)
fun removeEventListener(type: String, callback: EventListener?, options: dynamic = definedExternally)

Properties

name
Link copied to clipboard
open val name: String
onmessage
Link copied to clipboard
var onmessage: (MessageEvent) -> dynamic?