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 |queue| be an empty [=queue=] of [=/response=].
3218
3218
1. Let |raceFetchController| be null.
3219
3219
1. Let |raceResponse| be a [=race response=] whose [=race response/value=] is "<code>pending</code>".
3220
-
1. Run the following substeps [=in parallel=], but [=abort when=] |controller|'s [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>":
3220
+
1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>":
3221
3221
1. Set |raceFetchController| to the result of calling [=fetch=] given |request|, with [=fetch/processResponse=] set to the following steps given a [=/response=] |raceNetworkRequestResponse|:
3222
3222
1. If |raceNetworkRequestResponse|'s [=response/status=] is [=ok status=], then:
3223
3223
1. Set |raceResponse|'s [=race response/value=] to |raceNetworkRequestResponse|.
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=].
3245
3245
1. Set |preloadRequest|'s [=service-workers mode=] to "`none`".
3246
3246
1. Let |preloadFetchController| be null.
3247
-
1. Run the following substeps [=in parallel=], but [=abort when=] |controller|'s [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>":
3247
+
1. Run the following substeps [=in parallel=], but [=abort when=] |fetchController|'s [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>":
3248
3248
1. Set |preloadFetchController| to the result of [=Fetch|fetching=] |preloadRequest|.
3249
3249
3250
3250
To [=fetch/processResponse=] for |navigationPreloadResponse|, run these substeps:
1. If |raceResponse| is not null, [=map/set=] |activeWorker|'s [=service worker/global object=]'s [=race response map=][|request|] to |raceResponse|.
3303
3303
1. [=Queue a task=] |task| to run the following substeps:
3304
3304
1. Let |e| be the result of <a>creating an event</a> with {{FetchEvent}}.
3305
-
1. Let |controller| be a [=new=]{{AbortController}} object with |workerRealm|.
3306
-
1. Let |requestObject| be the result of [=Request/creating=] a {{Request}} object, given |request|, a new {{Headers}} object's [=guard=] which is "`immutable`", |controller|'s [=AbortController/signal=], and |workerRealm|.
3305
+
1. Let |abortController| be a [=new=]{{AbortController}} object with |workerRealm|.
3306
+
1. Let |requestObject| be the result of [=Request/creating=] a {{Request}} object, given |request|, a new {{Headers}} object's [=guard=] which is "`immutable`", |abortController|'s [=AbortController/signal=], and |workerRealm|.
3307
3307
1. Initialize |e|’s {{Event/type}} attribute to {{fetch!!event}}.
3308
3308
1. Initialize |e|’s {{Event/cancelable}} attribute to true.
3309
3309
1. Initialize |e|’s {{FetchEvent/request}} attribute to |requestObject|.
1. Else, [=ReadableStream/cancel=] |request|'s [=request/body=] with undefined.
3326
3326
1. If |response| is not null, then set |response|'s [=response/service worker timing info=] to |timingInfo|.
3327
3327
1. If |e|'s <a>canceled flag</a> is set, set |eventCanceled| to true.
3328
-
1. If |controller| [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>", then:
3329
-
1. Let |deserializedError| be a "{{AbortError}}" {{DOMException}}.
3330
-
1. If |controller|'s [=fetch controller/serialized abort reason=] is non-null, set |deserializedError| to the result of calling [$StructuredDeserialize$] with |controller|'s [=fetch controller/serialized abort reason=] and |workerRealm|. If that threw an exception or returns undefined, then set |deserializedError| to a "{{AbortError}}" {{DOMException}}.
3331
-
1. [=Queue a task=] to [=AbortController/signal abort=] on |controller| with |deserializedError|.
3328
+
1. If |fetchController| [=fetch controller/state=] is "<code>terminated</code>" or "<code>aborted</code>", then:
3329
+
1. Let |deserializedError| be the result of [=deserialize a serialized abort reason=] given |fetchController|'s [=fetch controller/serialized abort reason=] and |workerRealm|.
3330
+
1. [=Queue a task=] to [=AbortController/signal abort=] on |abortController| with |deserializedError|.
3332
3331
3333
3332
If |task| is discarded, set |handleFetchFailed| to true.
0 commit comments