You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li>Let <var>client</var> be the <a>context object</a>'s <a href="#dfn-service-worker-container-interface-client">service worker client</a>.</li>
787
-
<li>Let <var>scriptURL</var> be the result of <a for="url">parsing</a><var>scriptURL</var> with <a>entry settings object</a>'s <a>API base URL</a>.</li>
785
+
<li>Let <var>scriptURL</var> be the result of <a for="url">parsing</a><var>scriptURL</var> with the <a>context object</a>'s <a>relevant settings object</a>'s <a>API base URL</a>.</li>
788
786
<li>Let <var>scopeURL</var> be null.</li>
789
-
<li>If <var>options</var>.{{RegistrationOptions/scope}} is <a>present</a>, set <var>scopeURL</var> to <var>options</var>.{{RegistrationOptions/scope}}.</li>
787
+
<li>If <var>options</var>.{{RegistrationOptions/scope}} is <a>present</a>, set <var>scopeURL</var> to the result of <a for="url">parsing</a><var>options</var>.{{RegistrationOptions/scope}} with the <a>context object</a>'s <a>relevant settings object</a>'s <a>API base URL</a>.</li>
790
788
<li>Invoke [[#start-register-algorithm]] with <var>scopeURL</var>, <var>scriptURL</var>, <var>p</var>, <var>client</var>, <var>client</var>'s <a>creation URL</a> and <var>options</var>.{{RegistrationOptions/type}}.</li>
<li>Let <var>client</var> be the <a>context object</a>'s <a href="#dfn-service-worker-container-interface-client">service worker client</a>.</li>
802
-
<li>Let <var>clientURL</var> be the result of <a for="url">parsing</a><var>clientURL</var> with <a>entry settings object</a>'s <a>API base URL</a>.</li>
800
+
<li>Let <var>clientURL</var> be the result of <a for="url">parsing</a><var>clientURL</var> with the <a>context object</a>'s <a>relevant settings object</a>'s <a>API base URL</a>.</li>
803
801
<li>If <var>clientURL</var> is failure, return a <a>promise</a> rejected with a <code>TypeError</code>.</li>
804
802
<li>If the <a for="resource">origin</a> of <var>clientURL</var> is not <var>client</var>'s <a for="resource">origin</a>, return a <var>promise</var> rejected with a "{{SecurityError}}" exception.</li>
805
803
<li>Let <var>promise</var> be a new <a>promise</a>.</li>
<li>Let <var>request</var> be the <a for="fetch">request</a> for which this header was received in the response.</li>
2126
2124
<li>If <var>request</var>'s <a for="request">client</a> is not a <a>secure context</a>, abort these steps.</li>
2127
2125
<li>Let <var>scriptURL</var> be the result of <a for="url">parsing</a> the <a>target IRI</a> of the <code>Link</code> header.</li>
2128
-
<li>Let <var>scopeURL</var> be the "<code>scope</code>" <a>target attribute</a> of the <code>Link</code> header, or null if no such attribute is present.</li>
2126
+
<li>Let <var>scopeURL</var> be null.
2127
+
<li>If the "<code>scope</code>" <a>target attribute</a> of the <code>Link</code> header is present, set <var>scopeURL</var> to the result of <a for="url">parsing</a> the "<code>scope</code>" <a>target attribute</a> with <var>scriptURL</var>.</li>
2129
2128
<li>Let <var>workerType</var> be the "<code>workertype</code>" <a>target attribute</a> of the <code>Link</code> header, or "<code>classic</code>" if no such attribute is present.</li>
2130
2129
<li>If <var>workerType</var> is not a valid {{WorkerType}} value, abort these steps.</li>
2131
2130
<li>Invoke [[#start-register-algorithm]] with <var>scopeURL</var>, <var>scriptURL</var>, a new <a>promise</a>, null, <var>contextURL</var> and <var>workerType</var>.</li>
2132
2131
</ol>
2133
2132
2134
-
<p>When a <a>serviceworker link</a>'s <{link}> element is <a lt="in a document">inserted into a document</a>, a <a>serviceworker link</a> is created on a <{link}> element that is already <a>in a Document</a>, or the <{link/href}> or <{link/scope}> attributes of the <{link}> element of a <a>serviceworker link</a> is changed, the user agent <em class="rfc2119" title="SHOULD">should</em> run these steps:</p>
2133
+
<p>When a <a>serviceworker link</a>'s <{link}> element is <a>inserted into a document</a>, a <a>serviceworker link</a> is created on a <{link}> element that is already <a>in a document tree</a>, or the <{link/href}> or <{link/scope}> attributes of the <{link}> element of a <a>serviceworker link</a> is changed, the user agent <em class="rfc2119" title="SHOULD">should</em> run these steps:</p>
2135
2134
2136
2135
<ol>
2137
2136
<li>If the <{link/href}> attribute is the empty string, abort these steps.</li>
2138
2137
<li>Let <var>client</var> be the document's <a for="ServiceWorkerContainer">service worker client</a>.</li>
2139
2138
<li>If <var>client</var> is not a <a>secure context</a>, <a>queue a task</a> to <a>fire a simple event</a> named <code>error</code> at the <{link}> element, and abort these steps.</li>
2140
-
<li>Let <var>scriptURL</var> be the result of <a for="url">parsing</a> the <{link/href}> attribute with document's <a>document base URL</a>.</li>
2141
-
<li>Let <var>scopeURL</var> be the <{link/scope}> attribute, or null if the <{link/scope}> attribute is omitted.</li>
2139
+
<li>Let <var>scriptURL</var> be the result of <a for="url">parsing</a> the <{link/href}> attribute with the <{link}> element's <a>node document</a>'s <a>document base URL</a>.</li>
2140
+
<li>Let <var>scopeURL</var> null.
2141
+
<li>If the <{link/scope}> attribute is present, set <var>scopeURL</var> to the result of <a for="url">parsing</a> the <{link/scope}> attribute with the <{link}> element's <a>node document</a>'s <a>document base URL</a>.</li>
2142
2142
<li>Let <var>workerType</var> be the <{link/workertype}> attribute, or "<code>classic</code>" if the <{link/workertype}> attribute is omitted.</li>
2143
2143
<li>If <var>workerType</var> is not a valid {{WorkerType}} value, <a>queue a task</a> to <a>fire a simple event</a> named <code>error</code> at the <{link}> element, and abort these steps.</li>
2144
2144
<li>Let <var>promise</var> be a new <a>promise</a>.</li>
<li>If <var>scriptURL</var> is failure, reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
3155
3155
<li>If <var>scriptURL</var>'s <a for="url">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
3156
3156
<li>If any of the strings in <var>scriptURL</var>'s <a for="url">path</a> contains either <a>ASCII case-insensitive</a> "<code>%2f</code>" or <a>ASCII case-insensitive</a> "<code>%5c</code>", reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
3157
-
<li>Let <var>scopeURL</var> be null.</li>
3158
-
<li>If <var>scopeURLString</var> is null, set <var>scopeURL</var> to the result of <a for="url">parsing</a> a string "<code>./</code>" with <var>scriptURL</var>.
3157
+
<li>If <var>scopeURL</var> is null, set <var>scopeURL</var> to the result of <a for="url">parsing</a> the string "<code>./</code>" with <var>scriptURL</var>.
3159
3158
<p class="note">The scope url for the registration is set to the location of the service worker script by default.</p>
3160
3159
</li>
3161
-
<li>Else, set <var>scopeURL</var> to the result of <a for="url">parsing</a><var>scopeURLString</var> with <a>entry settings object</a>'s <a>API base URL</a>.</li>
3162
3160
<li>If <var>scopeURL</var> is failure, reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
3163
3161
<li>If <var>scopeURL</var>'s <a for="url">scheme</a> is not one of "<code>http</code>" and "<code>https</code>", reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
3164
3162
<li>If any of the strings in <var>scopeURL</var>'s <a for="url">path</a> contains either <a>ASCII case-insensitive</a> "<code>%2f</code>" or <a>ASCII case-insensitive</a> "<code>%5c</code>", reject <var>promise</var> with a <code>TypeError</code> and abort these steps.</li>
0 commit comments