ServiceWorkerMain

external class ServiceWorkerMain(source)

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

An IpcMainServiceWorker instance scoped to the service worker.

Link copied to clipboard

A string representing the scope URL of the service worker.

Link copied to clipboard

A string representing the script URL of the service worker.

Link copied to clipboard

A number representing the ID of the specific version of the service worker script in its scope.

Functions

Link copied to clipboard

Whether the service worker has been destroyed.

Link copied to clipboard
fun send(channel: String, vararg args: Any?)

Send an asynchronous message to the service worker process via channel, along with arguments. Arguments will be serialized with the Structured Clone Algorithm, just like postMessage, so prototype chains will not be included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will throw an exception.

Link copied to clipboard

Initiate a task to keep the service worker alive until ended.