InstallEvent Class

The install event of a service worker (https://w3c.github.io/ServiceWorker/#installevent).

public sealed class InstallEvent : ExtendableEvent
Inheritance
ExtendableEvent InstallEvent

Constructors

NameDescription
InstallEvent(string, ExtendableEventInit?)Creates an install event.

InstallEvent(string, ExtendableEventInit?)

ExtendableEvents.cs

Creates an install event.

public InstallEvent(string type, ExtendableEventInit? eventInitDict = null)

Methods

NameDescription
AddRoutes(RouterRule)Registers a rule of the static routing API (https://w3c.github.io/ServiceWorker/#dom-installevent-addroutes): the requests that match the condition of the rule are handled by its source before the fetch event is dispatched.
AddRoutes(IReadOnlyList<RouterRule>)Registers rules of the static routing API (https://w3c.github.io/ServiceWorker/#dom-installevent-addroutes): a request is handled by the source of the first rule whose condition it matches, before the fetch event is dispatched.

AddRoutes overloads

AddRoutes(RouterRule)

ExtendableEvents.cs

Registers a rule of the static routing API (https://w3c.github.io/ServiceWorker/#dom-installevent-addroutes): the requests that match the condition of the rule are handled by its source before the fetch event is dispatched.

public Task AddRoutes(RouterRule rules)
Parameters
rules RouterRule
Returns

Task A task completed when the rule is registered, or failed with a TypeErrorException when the rule is not valid.

See also

AddRoutes(IReadOnlyList<RouterRule>)

ExtendableEvents.cs

Registers rules of the static routing API (https://w3c.github.io/ServiceWorker/#dom-installevent-addroutes): a request is handled by the source of the first rule whose condition it matches, before the fetch event is dispatched.

public Task AddRoutes(IReadOnlyList<RouterRule> rules)
Parameters
rules IReadOnlyList<RouterRule>
Returns

Task A task completed when the rules are registered, or failed with a TypeErrorException when a rule is not valid or when there are too many conditions.

See also