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
<p><dfn attribute id="fetch-event-request-attribute"><code>request</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to.</p>
<p><dfn attribute id="fetch-event-preloadresponse-attribute"><code>preloadResponse</code></dfn> attribute <em class="rfc2119" title="MUST">must</em> return the value it was initialized to.</p>
<li>Let <var>client</var> be the <a href="#dfn-service-worker-client">service worker client</a> that corresponds to <var>request</var>'s <a for="request">client</a>.</li>
3720
-
<li>Let <var>navigationPreload</var> be null.</li>
3728
+
<li>Let <var>preloadResponse</var> be a new <a>promise</a>.</li>
3721
3729
<li>Assert: <var>request</var>'s <a for="request">destination</a> is not "<code>serviceworker</code>".</li>
3722
3730
<li>If <var>request</var> is a <a>potential-navigation-or-subresource request</a>, then:
<li>Let <var>preloadResponseObject</var> be a new {{Response}} object and a new associated {{Headers}} object whose <a>guard</a> is "<code>immutable</code>"</li>
3740
3748
<li><a>Append to header list</a><var>preloadRequestHeaders</var> a new <a>header</a> whose <a>name</a> is `<code>Service-Worker-Navigation-Preload</code>` and <a>value</a> is <var>registration</var>'s <a>navigation preload header value</a></li>
<li>Set <var>navigationPreload</var> to a new <a>promise</a>.</li>
3743
3750
<li>Run the following substeps <a>in parallel</a>:
3744
3751
<ol>
3745
3752
<li>
3746
3753
<p><a>Fetch</a><var>preloadRequest</var>.</p>
3747
-
<p>To <a>process response</a> for <var>preloadResponse</var>, run these substeps:</p>
3754
+
<p>To <a>process response</a> for <var>navigationPreloadResponse</var>, run these substeps:</p>
3748
3755
<ol>
3749
-
<li><p>If <var>preloadResponse</var>'s <a for="response">type</a> is "<code>error</code>", reject <var>navigationPreload</var> with a <code>TypeError</code> and terminate these substeps.</li>
3750
-
<li><p>Associate <var>preloadResponseObject</var> with <var>preloadResponse</var>.
3751
-
<li><p>Resolve <var>navigationPreload</var> with <var>preloadResponseObject</var>.
3752
-
</ol>
3756
+
<li>If <var>navigationPreloadResponse</var>'s <a for="response">type</a> is "<code>error</code>", reject <var>navigationPreload</var> with a <code>TypeError</code> and terminate these substeps.</li>
3757
+
<li>Associate <var>preloadResponseObject</var> with <var>navigationPreloadResponse</var>.
3758
+
<li>Resolve <var>preloadResponse</var> with <var>navigationPreloadResponse</var>.
3759
+
</ol>
3753
3760
</li>
3754
3761
</ol>
3755
3762
</li>
3756
3763
</ol>
3757
3764
</li>
3765
+
<li>Else, resolve <var>preloadResponse</var> with undefined.</li>
3758
3766
</ol>
3759
3767
<p class="note">From this point, the <a href="#dfn-service-worker-client">service worker client</a> starts to <a href="#dfn-use">use</a> its <a href="#dfn-service-worker-client-active-worker">active worker</a>'s <a href="#dfn-containing-service-worker-registration">containing service worker registration</a>.</p>
<li>Create a <a>trusted event</a><var>e</var> that uses the {{FetchEvent}} interface, with the event type <code><a href="#service-worker-global-scope-fetch-event">fetch</a></code>, which does not bubble.</li>
3776
3784
<li>Let the <a href="#fetch-event-request-attribute">request</a> attribute of <var>e</var> be initialized to <var>r</var>.</li>
3785
+
<li>Let the <a href="#fetch-event-preloadresponse-attribute">preloadResponse</a> attribute of <var>e</var> be initialized to <var>preloadResponse</var>.</li>
3777
3786
<li>Let the <a href="#fetch-event-clientid-attribute">clientId</a> attribute of <var>e</var> be initialized to <var>client</var>'s <a href="#dfn-service-worker-client-id">id</a> if <var>request</var> is not a <a>non-subresource request</a>, and to null otherwise.</li>
3778
3787
<li>Let the <a href="#fetch-event-isreload-attribute">isReload</a> attribute of <var>e</var> be initialized to <code>true</code> if <var>request</var>'s <a for="request">client</a> is a <a href="#dfn-window-client">window client</a> and the event was dispatched with the user's intention for the page reload, and <code>false</code> otherwise.</li>
0 commit comments