Skip to content

ElectronServiceWorkers

Unofficial

Provides access to the service workers registered within a session.

Import:

import type { ElectronServiceWorkers } from '@obsidian-typings/obsidian-public-latest';

Signature:

export interface ElectronServiceWorkers

Methods

MethodReturnsDescription
addListener(event, listener)thisRegisters a listener for the console-message event, emitted when a service worker logs to the console.
addListener(event, listener)thisRegisters a listener for the registration-completed event, emitted when a service worker has been registered.
getAllRunning()Record<number, ElectronServiceWorkerInfo>Returns all running service workers keyed by version ID.
getFromVersionID(versionId)ElectronServiceWorkerInfoReturns information about the service worker with the given version ID.
on('console-message', listener)thisRegisters a listener for the console-message event, emitted when a service worker logs to the console.
on('registration-completed', listener)thisRegisters a listener for the registration-completed event, emitted when a service worker has been registered.
once(event, listener)thisRegisters a one-time listener for the console-message event.
once(event, listener)thisRegisters a one-time listener for the registration-completed event.
removeListener(event, listener)thisRemoves a previously registered console-message event listener.
removeListener(event, listener)thisRemoves a previously registered registration-completed event listener.

Links to this page: