[w3c/ServiceWorker] Ensure the addRoutes() to be called within the install event (PR #1744)

This is a fix for https://github.com/w3c/ServiceWorker/issues/1743.

Currently, it is technically possible to call `addRoutes()` outside of the install event.  This change follows how `FetchEvent.respondWith()` deal with the case, and prevents the `addRoutes()` method to be used outside of the install event.


<!--
    This comment and the below content is programmatically generated.
    You may add a comma-separated list of anchors you'd like a
    direct link to below (e.g. #idl-serializers, #idl-sequence):

    Don't remove this comment or modify anything below this line.
    If you don't want a preview generated for this pull request,
    just replace the whole of this comment's content by "no preview"
    and remove what's below.
-->
***
<a href="https://pr-preview.s3.amazonaws.com/yoshisatoyanagisawa/ServiceWorker/pull/1744.html" title="Last updated on Jan 22, 2025, 3:52 AM UTC (494d7c6)">Preview</a> | <a href="https://pr-preview.s3.amazonaws.com/w3c/ServiceWorker/1744/9dbcd10...yoshisatoyanagisawa:494d7c6.html" title="Last updated on Jan 22, 2025, 3:52 AM UTC (494d7c6)">Diff</a>
You can view, comment on, or merge this pull request online at:

  https://github.com/w3c/ServiceWorker/pull/1744

-- Commit Summary --

  * Ensure the addRoutes() to be called within the install event

-- File Changes --

    M docs/index.bs (28)

-- Patch Links --

https://github.com/w3c/ServiceWorker/pull/1744.patch
https://github.com/w3c/ServiceWorker/pull/1744.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/ServiceWorker/pull/1744
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/ServiceWorker/pull/1744@github.com>

Received on Wednesday, 22 January 2025 03:53:16 UTC