Re: [w3c/ServiceWorker] ServiceWorker static routing API (PR #1701)

@yoshisatoyanagisawa commented on this pull request.



> +
+  <section algorithm>
+    <h3 id="match-router-condition-algorithm"><dfn>Match Router Condition</dfn></h3>
+      : Input
+      :: |condition|, a {{RouterCondition}}
+      :: |serviceWorker|, a [=/service worker=]
+      :: |request|, a [=/request=]
+      : Output
+      :: a boolean
+
+      Note: if there are multiple conditions (e.g. `urlPattern`, `runningStatus`, and `requestMethod` are set), all conditions will be matched to return true.
+
+      1. If |condition|["{{RouterCondition/urlPattern}}"] [=map/exists=], then:
+          1. Let |rawPattern| be |condition|["{{RouterCondition/urlPattern}}"].
+          1. Let |pattern| be the result of running <a>Parse URL Pattern</a> algorithm passing |rawPattern| and |serviceWorker|.
+          1. If running [=match=] with |pattern| and |request|'s [=request/URL=] returns null, return false.

Practically, URLPattern exec() and test() works because URL has necessary field to run [=match=].  However, I understand that you mean the type mismatch.

I have already contacted with @sisidovski, who is one of the authors of the URLPattern specification, to ask if we can make [=match=] accept URL.

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

Message ID: <w3c/ServiceWorker/pull/1701/review/1879279458@github.com>

Received on Wednesday, 14 February 2024 02:49:53 UTC