serviceworker
"serviceworker
keyword may be used with <{link}> elements. This keyword creates an external resource link (serviceworker link) that is used to declare a [=/service worker registration=] and its [=service worker registration/scope url=].
+ A [=/service worker registration=] and its [=service worker registration/scope url=] are created by a serviceworker link, which is declared using a "serviceworker" `Link` header or a <{link}> element whose <{link/rel}> attribute contains the keyword "[=html/serviceworker=]
".
Link
headerLink
header+ Link: <sw.js>; rel="serviceworker"; scope="/"; workertype="module"; updateviacache="all" ++
Link
headerLink
header that contains a serviceworker link, the user agent *should* run these steps:
@@ -1768,7 +1795,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
classic
" if the <{link/workertype}> attribute is omitted.
- 1. If |workerType| is not a valid {{WorkerType}} value, queue a task to fire an event named error
at the <{link}> element, and abort these steps.
+ 1. Let |workerType| be the state of the <{link/workertype}> attribute.
1. Let |useCache| be true if the <{link}> element has a <{link/usecache}> attribute, otherwise false.
1. Let |promise| be a new promise.
1. Invoke [=Start Register=] with |scopeURL|, |scriptURL|, |promise|, |client|, |client|'s creation URL, |workerType|, and |useCache|.
@@ -1811,24 +1837,6 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
- partial interface HTMLLinkElement { - [CEReactions] attribute USVString scope; - [CEReactions] attribute WorkerType workerType; - [CEReactions] attribute boolean useCache; - }; -- - The scope IDL attribute must reflect the element's scope content attribute. - - The workerType IDL attribute must reflect the element's workertype content attribute. - - The useCache IDL attribute must reflect the element's usecache content attribute. -