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
1. Let |preloadResponseObject| be a new {{Response}} object associated with a new {{Headers}} object whose [=guard=] is "`immutable`".
3023
3024
1. [=header list/Append=] to |preloadRequestHeaders| a new [=header=] whose [=header/name=] is \`<code>Service-Worker-Navigation-Preload</code>\` and [=header/value=] is |registration|'s [=navigation preload header value=].
3024
3025
1. Set |preloadRequest|'s [=service-workers mode=] to "`none`".
3025
-
1. Run the following substeps [=in parallel=]:
3026
-
1. [=Fetch=] |preloadRequest| and let |preloadFetchInstance| be the instance of the [=/fetch=] algorithm.
3026
+
1. Let |preloadFetchController| be null.
3027
+
1. Run the following substeps [=in parallel=], but [=abort when=] |controller|'s [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>":
3028
+
1. Set |preloadFetchController| to the result of [=Fetch|fetching=] |preloadRequest|.
3027
3029
3028
3030
To [=process response=] for |navigationPreloadResponse|, run these substeps:
3029
3031
3030
3032
1. If |navigationPreloadResponse|'s [=response/type=] is "`error`", reject |preloadResponse| with a `TypeError` and terminate these substeps.
3031
3033
1. Associate |preloadResponseObject| with |navigationPreloadResponse|.
3032
3034
1. Resolve |preloadResponse| with |preloadResponseObject|.
3033
-
1. If |fetchInstance| is [=fetch/terminated=], then [=fetch/terminate=] |preloadFetchInstance| with the aborted flag set.
3035
+
1. [=If aborted=], then [=fetch controller/abort=] |preloadFetchController|.
3034
3036
1. Else, resolve |preloadResponse| with undefined.
3035
3037
3036
3038
Note: From this point, the [=/service worker client=] starts to <a>use</a> its <a>active service worker</a>'s <a>containing service worker registration</a>.
1. Else, [=ReadableStream/cancel=] |request|'s [=request/body=] with undefined.
3077
3079
1. If |response| is not null, then set |response|'s [=response/service worker timing info=] to |timingInfo|.
3078
3080
1. If |e|'s <a>canceled flag</a> is set, set |eventCanceled| to true.
3079
-
1. If |fetchInstance| is [=fetch/terminated=], then [=queue a task=] to [=AbortSignal/signal abort=] on |requestObject|'s {{Request/signal}}.
3081
+
1. If |controller| [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>", then [=queue a task=] to [=AbortSignal/signal abort=] on |requestObject|'s {{Request/signal}}.
3080
3082
3081
3083
If |task| is discarded, set |handleFetchFailed| to true.
0 commit comments