Skip to content

Commit

Permalink
Upstream IDL change from Trusted Types (#1709)
Browse files Browse the repository at this point in the history
Changes register to take a union of (TrustedScriptURL or USVString) rather than just a USVString.

Updates the register method steps to call Get Trusted Type compliant string
  • Loading branch information
lukewarlow authored Apr 30, 2024
1 parent 8d64a5c commit 8ac9c66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
readonly attribute ServiceWorker? controller;
readonly attribute Promise<ServiceWorkerRegistration> ready;

[NewObject] Promise<ServiceWorkerRegistration> register(USVString scriptURL, optional RegistrationOptions options = {});
[NewObject] Promise<ServiceWorkerRegistration> register((TrustedScriptURL or USVString) scriptURL, optional RegistrationOptions options = {});

[NewObject] Promise<(ServiceWorkerRegistration or undefined)> getRegistration(optional USVString clientURL = "");
[NewObject] Promise<FrozenArray<ServiceWorkerRegistration>> getRegistrations();
Expand Down Expand Up @@ -782,6 +782,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
The <dfn method for="ServiceWorkerContainer"><code>register(|scriptURL|, |options|)</code></dfn> method steps are:

1. Let |p| be a <a>promise</a>.
1. Set |scriptURL| to the result of invoking [$Get Trusted Type compliant string$] with {{TrustedScriptURL}}, [=this=]'s [=relevant global object=], |scriptURL|, "ServiceWorkerContainer register", and "script".
1. Let |client| be [=this=]'s [=ServiceWorkerContainer/service worker client=].
1. Let |scriptURL| be the result of <a lt="URL parser">parsing</a> |scriptURL| with [=this=]'s <a>relevant settings object</a>'s <a>API base URL</a>.
1. Let |scopeURL| be null.
Expand Down

0 comments on commit 8ac9c66

Please sign in to comment.