Re: [w3c/ServiceWorker] Add a static routing API support. (PR #1686)

@yoshisatoyanagisawa commented on this pull request.



> +        1. If |rules| is a sequence of {{RouterRule}} dictionaries.
+            1.  for each |rule| in |rules|:
+                1. If running [=VerifyRouterRule=] algorithm with |rule| returns false, <a>throw</a> a <code>TypeError</code>.
+                1. Append |rule| to |routerRules|.
+        1. Set |routerRules| to [=/service worker=]'s [=static router rules object=].
+
+      <section>
+        <h5 id="verify-router-rule-algorithm"><dfn>VerifyRouterRule</dfn></h5>
+          : Input
+          :: |rule|, RouterRule
+          : Output
+          :: a boolean
+
+          1. If |rule|'s |condition| is empty, and abort these steps.
+          1. If |rule|'s |condition|'s |urlPattern| is empty, return false..
+          1. If |urlPattern| contains a regular expression, return false.

It is actually like: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/modules/service_worker/service_worker_router_type_converter.cc;l=41

I have updated the document to align with what the code actually do.

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

Message ID: <w3c/ServiceWorker/pull/1686/review/1525794184@github.com>

Received on Wednesday, 12 July 2023 08:26:11 UTC