Have a voice in guiding the future of Google's developer brands. Share your thoughts in our survey.

Class: NavigationRoute

Constructor

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 options have the following properties:

Parameter

denylist

Optional

Array of RegExp

If any of these patterns match, the route will not handle the request (even if a allowlist RegExp matches).

allowlist

Optional

Array of RegExp

If any of these patterns match the URL's pathname and search parameter, the route will handle the request (assuming the denylist doesn't match).

Extends
module:workbox-routing.Route