ServiceWorkerContainer

abstract external class ServiceWorkerContainer : EventTarget (source)

Platform and version requirements: JS

Exposes the JavaScript ServiceWorkerContainer to Kotlin

Constructors

<init>

ServiceWorkerContainer()

Exposes the JavaScript ServiceWorkerContainer to Kotlin

Properties

controller

open val controller: ServiceWorker?

oncontrollerchange

open var oncontrollerchange: (Event) -> dynamic

onmessage

open var onmessage: (Event) -> dynamic

ready

Functions

getRegistration

fun getRegistration(
    clientURL: String = definedExternally
): Promise<Any?>

getRegistrations

fun getRegistrations(): Promise<dynamic>

register

fun register(
    scriptURL: String,
    options: RegistrationOptions = definedExternally
): Promise<ServiceWorkerRegistration>

startMessages

fun startMessages()

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)