Skip to content

Commit 8ac9c66

Browse files
authored
Upstream IDL change from Trusted Types (#1709)
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
1 parent 8d64a5c commit 8ac9c66

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

docs/index.bs

+2-1
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
713713
readonly attribute ServiceWorker? controller;
714714
readonly attribute Promise<ServiceWorkerRegistration> ready;
715715

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

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

784784
1. Let |p| be a <a>promise</a>.
785+
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".
785786
1. Let |client| be [=this=]'s [=ServiceWorkerContainer/service worker client=].
786787
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>.
787788
1. Let |scopeURL| be null.

0 commit comments

Comments
 (0)