RouterCondition Class

The condition of a RouterRule (https://w3c.github.io/ServiceWorker/#dictdef-routercondition): a request matches when it matches all the members that are present. RouterCondition.Or and RouterCondition.Not cannot be combined with the other members. A null member is not present.

public sealed class RouterCondition

Constructors

NameDescription
RouterCondition()

RouterCondition()

public RouterCondition()

No documentation is available.

Properties

NameDescription
NotGets the condition that must not match.
OrGets the conditions of which one must match.
RequestDestinationGets the destination of the request (e.g. script, style, document, or the empty string).
RequestMethodGets the method of the request (normalized before the comparison, e.g. post matches POST).
RequestModeGets the mode of the request (navigate, same-origin, no-cors or cors).
RunningStatusGets whether the service worker must be running, or not running.
UrlPatternGets the pattern of the URL of the request, relative to the URL of the script of the service worker. A pattern with regular expression groups is not allowed.

Gets the condition that must not match.

public RouterCondition? Not { get; init; }

Gets the conditions of which one must match.

public IReadOnlyList<RouterCondition>? Or { get; init; }

RequestDestination

ServiceWorkerRouter.cs

Gets the destination of the request (e.g. script, style, document, or the empty string).

public string? RequestDestination { get; init; }

Gets the method of the request (normalized before the comparison, e.g. post matches POST).

public string? RequestMethod { get; init; }

Gets the mode of the request (navigate, same-origin, no-cors or cors).

public string? RequestMode { get; init; }

Gets whether the service worker must be running, or not running.

public RunningStatus? RunningStatus { get; init; }

Gets the pattern of the URL of the request, relative to the URL of the script of the service worker. A pattern with regular expression groups is not allowed.

public UrlPatternCompatible? UrlPattern { get; init; }