Options
All
  • Public
  • Public/Protected
  • All
Menu

External module scripts/bg/sw

Manage lifecycle of our {@link ServiceWorker}

Index

Variables

Const ERROR_NOT_SUBSCRIBED

ERROR_NOT_SUBSCRIBED: "The extension has lost the subscription to receive push notifications." = "The extension has lost the subscription to receive push notifications."

Const ERR_REG

ERR_REG: "Failed to register Service Worker: " = "Failed to register Service Worker: "

Const ERR_UNREG

ERR_UNREG: "Failed to unregister Service Worker: " = "Failed to unregister Service Worker: "

Const ERR_UNREG_BOOL

ERR_UNREG_BOOL: "returned false" = "returned false"

Const ERR_UNSUB

ERR_UNSUB: "Failed to unsubscribe from push notifications: " = "Failed to unsubscribe from push notifications: "

Const PATH

PATH: "../scripts/sw.js" = "../scripts/sw.js"

Path to our {@link ServiceWorker}

Let swRegistration

swRegistration: ServiceWorkerRegistration | null = null

Our ServiceWorkerRegistration object

Functions

cantReceive

  • cantReceive(): Promise<null | string>

initialize

  • initialize(): Promise<void>

isSubscribed

  • isSubscribed(): Promise<boolean>

register

  • register(): Promise<ServiceWorkerRegistration>
  • Register the Service Worker

    remarks

    This can be called if already registered

    throws

    An error if register failed

    Returns Promise<ServiceWorkerRegistration>

    The service worker

unregister

  • unregister(): Promise<void>

unsubscribePush

  • unsubscribePush(): Promise<boolean>

update

  • update(): Promise<void>

Generated using TypeDoc