You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The <dfn method for="InstallEvent"><code>addRoutes(|rules|)</code></dfn> method steps are:
1607
1607
1608
-
1. Let |event| be [=this=].
1609
-
1. If |event|'s [=dispatch flag=] is unset, [=throw=] an "{{InvalidStateError}}" {{DOMException}}.
1610
1608
1. If |rules| is a {{RouterRule}} dictionary, set |rules| to « |rules| ».
1611
1609
1. Let |serviceWorker| be the [=current global object=]'s associated [=ServiceWorkerGlobalScope/service worker=].
1612
1610
1. For each |rule| of |rules|:
1613
1611
1. If running the [=Verify Router Condition=] algorithm with |rule|["{{RouterRule/condition}}"] and |serviceWorker| returns false, return [=a promise rejected with=] a {{TypeError}}.
1614
1612
1. If |rule|["{{RouterRule/source}}"] is "{{RouterSourceEnum/fetch-event}}" and |serviceWorker|'s [=set of event types to handle=] does not [=set/contain=]{{ServiceWorkerGlobalScope/fetch!!event}}, return [=a promise rejected with=] a {{TypeError}}.
1615
1613
1. Let |lifetimePromise| be a new [=promise=].
1616
-
1. [=ExtendableEvent/Add lifetime promise=] |lifetimePromise| to |event|.
1614
+
1. [=ExtendableEvent/Add lifetime promise=] |lifetimePromise| to [=this=].
1617
1615
1618
1616
Note: {{InstallEvent/addRoutes(rules)|event.addRoutes(rules)}} extends the lifetime of the event by default as if {{ExtendableEvent/waitUntil()|event.waitUntil(promise)}} is called.
0 commit comments