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. [=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=].
2962
2963
1. Set |preloadRequest|'s [=service-workers mode=] to "`none`".
2963
2964
1. Run the following substeps [=in parallel=]:
2964
-
1. [=Fetch=] |preloadRequest|.
2965
+
1. [=Fetch=] |preloadRequest| and let |preloadFetchInstance| be the instance of the [=/fetch=] algorithm.
2965
2966
2966
2967
To [=process response=] for |navigationPreloadResponse|, run these substeps:
2967
2968
2968
2969
1. If |navigationPreloadResponse|'s [=response/type=] is "`error`", reject |preloadResponse| with a `TypeError` and terminate these substeps.
2969
2970
1. Associate |preloadResponseObject| with |navigationPreloadResponse|.
2970
2971
1. Resolve |preloadResponse| with |navigationPreloadResponse|.
2972
+
1. If |fetchInstance| is [=fetch/terminated=], then [=fetch/terminate=] |preloadFetchInstance| with the aborted flag set.
2971
2973
1. Else, resolve |preloadResponse| with undefined.
2972
2974
2973
2975
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. Invoke <a>Run Service Worker</a> algorithm with |activeWorker| as the argument.
2988
2990
1. <a>Queue a task</a> |task| to run the following substeps:
2989
2991
1. Let |e| be the result of <a>creating an event</a> with {{FetchEvent}}.
2992
+
1. Let |requestObject| be a new {{Request}} object associated with |request| and a new associated {{Headers}} object whose [=guard=] is "`immutable`".
2990
2993
1. Initialize |e|’s {{Event/type}} attribute to {{fetch!!event}}.
2991
2994
1. Initialize |e|’s {{Event/cancelable}} attribute to true.
2992
-
1. Initialize |e|’s {{FetchEvent/request}} attribute to a new {{Request}} object associated with |request| and a new associated {{Headers}} object whose [=guard=] is "`immutable`".
2995
+
1. Initialize |e|’s {{FetchEvent/request}} attribute to |requestObject|.
2993
2996
1. Initialize |e|’s {{FetchEvent/preloadResponse}} to |preloadResponse|.
2994
2997
1. Initialize |e|'s {{FetchEvent/clientId}} attribute to |client|'s [=environment/id=].
2995
2998
1. If |request| is a <a>non-subresource request</a> and |request|'s [=request/destination=] is not {{RequestDestination/"report"}}, initialize |e|'s {{FetchEvent/reservedClientId}} attribute to |reservedClient|'s [=environment/id=], and to the empty string otherwise.
1. If |e|'s [=FetchEvent/respond-with error flag=] is set, set |handleFetchFailed| to true.
3003
3006
1. Else, set |response| to |e|'s [=FetchEvent/potential response=].
3004
3007
1. If |e|'s <a>canceled flag</a> is set, set |eventCanceled| to true.
3008
+
1. If |fetchInstance| is [=fetch/terminated=], then [=queue a task=] to [=AbortSignal/signal abort=] on |requestObject|'s {{Request/signal}}.
3005
3009
3006
3010
If |task| is discarded or the script has been aborted by the <a lt="terminate service worker">termination</a> of |activeWorker|, set |handleFetchFailed| to true.
0 commit comments