Header menu logo fable-electron-docs-api

ServiceWorkerMain Type

⚠ Process Availability: Main ✔ | Renderer ❌ | Utility ❌ | Exported ❌

Instance members

Instance member Description

this.ipc

Full Usage: this.ipc

Returns: IpcMainServiceWorker

An IpcMainServiceWorker instance scoped to the service worker.

Returns: IpcMainServiceWorker

this.isDestroyed ()

Full Usage: this.isDestroyed ()

Returns: bool
Modifiers: inline

Whether the service worker has been destroyed.

Returns: bool

this.scope

Full Usage: this.scope

Returns: string

A string representing the scope URL of the service worker.

Returns: string

this.scriptURL

Full Usage: this.scriptURL

Returns: string

A string representing the script URL of the service worker.

Returns: string

this.send (channel, ...args)

Full Usage: this.send (channel, ...args)

Parameters:
    channel : string
    ...args : obj[]

Modifiers: inline

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.The service worker process can handle the message by listening to channel with the ipcRenderer module.

channel : string
...args : obj[]

this.startTask ()

Full Usage: this.startTask ()

Returns: StartTask
Modifiers: inline

  • end Function - Method to call when the task has ended. If never called, the service won't terminate while otherwise idle.Initiate a task to keep the service worker alive until ended.

Returns: StartTask

this.versionId

Full Usage: this.versionId

Returns: float

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

Returns: float

Type something to start searching.