ServiceWorker

abstract external class ServiceWorker : 
    EventTarget,
    AbstractWorker,
    UnionMessagePortOrServiceWorker,
    UnionClientOrMessagePortOrServiceWorker
(source)

Platform and version requirements: JS

Exposes the JavaScript ServiceWorker to Kotlin

Constructors

<init>

ServiceWorker()

Exposes the JavaScript ServiceWorker to Kotlin

Properties

onstatechange

open var onstatechange: (Event) -> dynamic

scriptURL

open val scriptURL: String

state

open val state: ServiceWorkerState

Inherited Properties

onerror

abstract var onerror: (Event) -> dynamic

Functions

postMessage

fun postMessage(
    message: Any?,
    transfer: Array<dynamic> = definedExternally)

Inherited Functions

addEventListener

fun addEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun addEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)

dispatchEvent

fun dispatchEvent(event: Event): Boolean

removeEventListener

fun removeEventListener(
    type: String,
    callback: EventListener?,
    options: dynamic = definedExternally)
fun removeEventListener(
    type: String,
    callback: (Event) -> Unit,
    options: dynamic = definedExternally)