v140 · service worker routing

Which sources the router accepts

Six candidate sources offered to a real addRoutes call inside a real install event, one at a time so a rejection cannot hide the rest. The messages below are the browser's, verbatim.

Every source, offered separately

What the browser did with each source
sourceaccepted?what the browser said
Waiting for the worker…
Registering…

The rejections are the interesting rows. fetch-event and the race source are refused unless the worker actually has a fetch handler — the browser will not let you route to a handler that does not exist — and an invented source fails at the enum conversion, with a message about reading the property rather than about the value.

The rejection arrives late

addRoutes returns a promise, so a bad rule does not throw at the call site. In an install handler that means a rejected route can be missed entirely unless the promise is passed to waitUntil or awaited — and the worker installs anyway, with a routing table quietly missing a rule.

The routes this worker actually installed

Rules the demos depend on
patternsourceinstalled?
Waiting…

see also