ServiceWorkerContainer

Overview

The ServiceWorkerContainer interface of the Service Worker API provides an object representing the service worker as an overall unit in the network ecosystem, including facilities to register, unregister and update service workers, and access the state of service workers and their registrations.

Location

 

controller

 

property controller: dynamic read;

 

dynamic controller { get; }

 

var controller: dynamic { get{} }

 

dynamic controller { __get; }

 

ReadOnly Property controller() As dynamic

getRegistration

Gets a ServiceWorkerRegistration object whose scope matches the provided document URL.  The method returns a Promise that resolves to a ServiceWorkerRegistration or undefined.

 

method getRegistration(parscope: dynamic): dynamic

 

dynamic getRegistration(dynamic parscope)

 

func getRegistration(_ parscope: dynamic) -> dynamic

 

dynamic getRegistration(dynamic parscope)

 

Function getRegistration(parscope As dynamic) As dynamic

Parameters:

  • parscope:

getRegistrations

Returns all ServiceWorkerRegistration objects associated with a ServiceWorkerContainer in an array.  The method returns a Promise that resolves to an array of ServiceWorkerRegistration.

 

method getRegistrations: array of ServiceWorkerRegistration

 

ServiceWorkerRegistration[] getRegistrations()

 

func getRegistrations() -> ServiceWorkerRegistration...

 

ServiceWorkerRegistration[] getRegistrations()

 

Function getRegistrations() As ServiceWorkerRegistration()

ready

 

property ready: dynamic read;

 

dynamic ready { get; }

 

var ready: dynamic { get{} }

 

dynamic ready { __get; }

 

ReadOnly Property ready() As dynamic

register

Creates or updates a ServiceWorkerRegistration for the given scriptURL.

 

method register(parscriptURL: dynamic; paroptions: dynamic): dynamic

 

dynamic register(dynamic parscriptURL, dynamic paroptions)

 

func register(_ parscriptURL: dynamic, _ paroptions: dynamic) -> dynamic

 

dynamic register(dynamic parscriptURL, dynamic paroptions)

 

Function register(parscriptURL As dynamic, paroptions As dynamic) As dynamic

Parameters:

  • parscriptURL:
  • paroptions:

startMessages

explicitly starts the flow of messages being dispatched from a service worker to pages under its control (e.g. sent via Client.postMessage()). This can be used to react to sent messages earlier, even before that page's content has finished loading.

 

method startMessages: dynamic

 

dynamic startMessages()

 

func startMessages() -> dynamic

 

dynamic startMessages()

 

Function startMessages() As dynamic

 

controller

 

property controller: dynamic read;

 

dynamic controller { get; }

 

var controller: dynamic { get{} }

 

dynamic controller { __get; }

 

ReadOnly Property controller() As dynamic

ready

 

property ready: dynamic read;

 

dynamic ready { get; }

 

var ready: dynamic { get{} }

 

dynamic ready { __get; }

 

ReadOnly Property ready() As dynamic

 

getRegistration

Gets a ServiceWorkerRegistration object whose scope matches the provided document URL.  The method returns a Promise that resolves to a ServiceWorkerRegistration or undefined.

 

method getRegistration(parscope: dynamic): dynamic

 

dynamic getRegistration(dynamic parscope)

 

func getRegistration(_ parscope: dynamic) -> dynamic

 

dynamic getRegistration(dynamic parscope)

 

Function getRegistration(parscope As dynamic) As dynamic

Parameters:

  • parscope:

getRegistrations

Returns all ServiceWorkerRegistration objects associated with a ServiceWorkerContainer in an array.  The method returns a Promise that resolves to an array of ServiceWorkerRegistration.

 

method getRegistrations: array of ServiceWorkerRegistration

 

ServiceWorkerRegistration[] getRegistrations()

 

func getRegistrations() -> ServiceWorkerRegistration...

 

ServiceWorkerRegistration[] getRegistrations()

 

Function getRegistrations() As ServiceWorkerRegistration()

register

Creates or updates a ServiceWorkerRegistration for the given scriptURL.

 

method register(parscriptURL: dynamic; paroptions: dynamic): dynamic

 

dynamic register(dynamic parscriptURL, dynamic paroptions)

 

func register(_ parscriptURL: dynamic, _ paroptions: dynamic) -> dynamic

 

dynamic register(dynamic parscriptURL, dynamic paroptions)

 

Function register(parscriptURL As dynamic, paroptions As dynamic) As dynamic

Parameters:

  • parscriptURL:
  • paroptions:

startMessages

explicitly starts the flow of messages being dispatched from a service worker to pages under its control (e.g. sent via Client.postMessage()). This can be used to react to sent messages earlier, even before that page's content has finished loading.

 

method startMessages: dynamic

 

dynamic startMessages()

 

func startMessages() -> dynamic

 

dynamic startMessages()

 

Function startMessages() As dynamic