StoredServiceWorker Class

An installed or activated service worker (https://w3c.github.io/ServiceWorker/#dfn-service-worker) stored by a ServiceWorkerBackend.

public sealed class StoredServiceWorker

Constructors

NameDescription
StoredServiceWorker()

StoredServiceWorker()

ServiceWorkerBackend.cs
  • Obsolete: Constructors of types with required members are not supported in this version of your compiler.
[Obsolete("Constructors of types with required members are not supported in this version of your compiler.", true)]
public StoredServiceWorker()

No documentation is available.

Properties

NameDescription
ClassicScriptsImportedGets whether the classic scripts imported flag is set (https://w3c.github.io/ServiceWorker/#dfn-classic-scripts-imported-flag).
EventTypesToHandleGets the types of the events the service worker handles (https://w3c.github.io/ServiceWorker/#dfn-set-of-event-types-to-handle), e.g. fetch.
IdGets the identifier of the service worker, unique in its registration.
RouterRulesGets the rules registered by InstallEvent.addRoutes() (https://w3c.github.io/ServiceWorker/#dfn-list-of-router-rules), in order.
ScriptUrlGets the serialized URL of the script (https://w3c.github.io/ServiceWorker/#dfn-script-url).
ScriptsGets the responses of the scripts of the service worker (https://w3c.github.io/ServiceWorker/#dfn-script-resource-map): its main script and the scripts it imports.
StateGets whether the service worker was activated (activated) or only installed (installed).
TypeGets the type of the script: classic or module.
UsedScriptUrlsGets the URLs of the scripts imported by the service worker (https://w3c.github.io/ServiceWorker/#dfn-set-of-used-scripts).

ClassicScriptsImported

ServiceWorkerBackend.cs

Gets whether the classic scripts imported flag is set (https://w3c.github.io/ServiceWorker/#dfn-classic-scripts-imported-flag).

public bool ClassicScriptsImported { get; init; }

Property value

bool

EventTypesToHandle

ServiceWorkerBackend.cs

Gets the types of the events the service worker handles (https://w3c.github.io/ServiceWorker/#dfn-set-of-event-types-to-handle), e.g. fetch.

public IReadOnlyList<string> EventTypesToHandle { get; init; }

Property value

IReadOnlyList<string>

Gets the identifier of the service worker, unique in its registration.

public required string Id { get; init; }

Property value

string

Gets the rules registered by InstallEvent.addRoutes() (https://w3c.github.io/ServiceWorker/#dfn-list-of-router-rules), in order.

public IReadOnlyList<StoredServiceWorkerRouterRule> RouterRules { get; init; }

Gets the serialized URL of the script (https://w3c.github.io/ServiceWorker/#dfn-script-url).

public required string ScriptUrl { get; init; }

Property value

string

Gets the responses of the scripts of the service worker (https://w3c.github.io/ServiceWorker/#dfn-script-resource-map): its main script and the scripts it imports.

public IReadOnlyList<StoredServiceWorkerScript> Scripts { get; init; }

Gets whether the service worker was activated (activated) or only installed (installed).

public string State { get; init; }

Property value

string

Gets the type of the script: classic or module.

public string Type { get; init; }

Property value

string

Gets the URLs of the scripts imported by the service worker (https://w3c.github.io/ServiceWorker/#dfn-set-of-used-scripts).

public IReadOnlyList<string> UsedScriptUrls { get; init; }

Property value

IReadOnlyList<string>