InstallEvent Class
The install event of a service worker (https://w3c.github.io/ServiceWorker/#installevent).
public sealed class InstallEvent : ExtendableEvent- Inheritance
ExtendableEventInstallEvent
Constructors
| Name | Description |
|---|---|
| InstallEvent(string, ExtendableEventInit?) | Creates an install event. |
InstallEvent(string, ExtendableEventInit?)
ExtendableEvents.csCreates an install event.
public InstallEvent(string type, ExtendableEventInit? eventInitDict = null)Methods
| Name | Description |
|---|---|
| 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.csRegisters 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
rulesRouterRule
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.csRegisters 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
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.