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
A [=/service worker registration=] has an associated <dfn export>navigation preload enabled flag</dfn>. It is initially unset.
207
207
208
-
A [=/service worker registration=] has an associated <dfn export>navigation preload header value</dfn>, which is a [=DOMString=]. It is initially set to "<code>true</code>".
208
+
A [=/service worker registration=] has an associated <dfn export>navigation preload header value</dfn>, which is a DOMString. It is initially set to "<code>true</code>".
The {{NavigationPreloadManager/disable()}} method, when invoked, *must* return a new [=promise=] |promise| and run the following steps [=in parallel=]:
The {{NavigationPreloadManager/setHeaderValue(value)}} method, when invoked, *must* return [=a new promise=] |promise| and run the following steps [=in parallel=]:
782
+
The <a method for="NavigationPreloadManager"><code>setHeaderValue(|value|)</code></a> method, when invoked, *must* return [=a new promise=] |promise| and run the following steps [=in parallel=]:
783
783
784
784
1. Let |registration| be the [=context object=]'s associated [=/service worker registration=].
785
785
1. If |registration|'s [=active worker=] is null, [=reject=] |promise| with a <code>TypeError</code>, and abort these steps.
The {{NavigationPreloadManager/getState()}} method, when invoked, *must* return [=a new promise=] |promise| and run the following steps [=in parallel=]:
1. Set |registration| to the result of running <a>Match Service Worker Registration</a> algorithm passing |request|'s [=request/url=] as the argument.
2848
2848
1. If |registration| is null or |registration|'s <a>active worker</a> is null, return null.
2849
2849
1. If |request|'s [=request/destination=] is not {{RequestDestination/"report"}}, set |reservedClient|'s <a>active service worker</a> to |registration|'s <a>active worker</a>.
2850
-
1. If |request| is a [=navigation request=] and |registration|'s [=navigation preload enabled flag=] is set, and |request|'s [=method=] is `<code>GET</code>`, then:
2850
+
1. If |request| is a [=navigation request=] and |registration|'s [=navigation preload enabled flag=] is set, and |request|'s [=request/method=] is "`GET`", then:
2851
2851
1. Let |preloadRequest| be the result of [=request/cloning=] the request |request|
2852
-
1. Let |preloadRequestHeaders| be |preloadRequest|'s [=header list=]
2853
-
1. Let |preloadResponseObject| be a new {{Response}} object and a new associated {{Headers}} object whose [=guard=] is "<code>immutable</code>"
2854
-
1. [=Append to header list=] |preloadRequestHeaders| a new [=header=] whose [=name=] is `<code>Service-Worker-Navigation-Preload</code>` and [=value=] is |registration|'s [=navigation preload header value=]
2852
+
1. Let |preloadRequestHeaders| be |preloadRequest|'s [=request/header list=]
2853
+
1. Let |preloadResponseObject| be a new {{Response}} object and a new associated {{Headers}} object whose [=guard=] is "`immutable`"
2854
+
1. [=header list/Append=]to |preloadRequestHeaders| a new [=header=] whose [=header/name=] is "`Service-Worker-Navigation-Preload`" and [=header/value=] is |registration|'s [=navigation preload header value=]
2855
2855
1. Set |preloadRequest|'s [=skip-service-worker flag=]
2856
2856
1. Run the following substeps [=in parallel=]:
2857
2857
1. [=Fetch=] |preloadRequest|.
2858
2858
2859
2859
To [=process response=] for |navigationPreloadResponse|, run these substeps:
2860
2860
2861
-
1. If |navigationPreloadResponse|'s [=response/type=] is "<code>error</code>", reject |navigationPreload| with a <code>TypeError</code> and terminate these substeps.
2861
+
1. If |navigationPreloadResponse|'s [=response/type=] is "`error`", reject |preloadResponse| with a `TypeError` and terminate these substeps.
2862
2862
1. Associate |preloadResponseObject| with |navigationPreloadResponse|.
2863
2863
1. Resolve |preloadResponse| with |navigationPreloadResponse|.
2864
2864
1. Else, resolve |preloadResponse| with undefined.
0 commit comments