workbox-routing. NavigationRoute
NavigationRoute makes it easy to create a Route that matches for browser navigation requests.
It will only match incoming Requests whose
mode
is set to navigate
.
You can optionally only apply this route to a subset of navigation requests
by using one or both of the denylist
and allowlist
parameters.
Constructor
NavigationRoute
new NavigationRoute(handler, options)
If both denylist
and allowlist
are provided, the denylist
will
take precedence and the request will not match this route.
The regular expressions in allowlist
and denylist
are matched against the concatenated
pathname
and search
portions of the requested URL.
Parameter |
|||||||
---|---|---|---|---|---|---|---|
handler |
module:workbox-routing~handlerCallback A callback function that returns a Promise resulting in a Response. |
||||||
options |
Object Values in
|
- Extends
- module:workbox-routing.Route
Method
setCatchHandler
setCatchHandler(handler)
Parameter |
|
---|---|
handler |
A callback function that returns a Promise resolving to a Response |
- Inherited from
- module:workbox-routing.Route#setCatchHandler