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
Opt cache.add/addAll and importScripts out of a local service worker (#1025)
* Opt cache.add/addAll and importScripts out of a local service worker
* Updating to enum
* Adding to v1
* “service-workers mode”
* Fixing preload request. Generating html.
1. If |r|'s [=request/url=]'s [=url/scheme=] is not one of "<code>http</code>" and "<code>https</code>", then:
1976
1976
1. [=fetch/Terminate=] all the ongoing <a>fetches</a> initiated by |requests| with reason *fatal*.
1977
1977
1. Break the loop.
1978
+
1. If |r|'s [=request/client=]'s [=environment settings object/global object=] is a {{ServiceWorkerGlobalScope}} object, set |request|'s [=service-workers mode=] to "`foreign`".
1978
1979
1. Set |r|'s [=request/initiator=] to "<code>fetch</code>" and [=request/destination=] to "<code>subresource</code>".
1979
1980
1. Add a {{Request}} object associated with |r| to |requestArray|.
To [=fetching scripts/perform the fetch=] given |request|, run the following steps:
2590
2592
2593
+
1. Append \`<code>Service-Worker</code>\`/\`<code>script</code>\` to |request|'s [=request/header list=].
2594
+
2595
+
Note: See the definition of the Service-Worker header in Appendix B: Extended HTTP headers.
2596
+
2591
2597
1. Set |request|'s [=request/cache mode=] to "<code>no-cache</code>" if any of the following are true:
2592
2598
* |registration|'s [=service worker registration/use cache=] is false.
2593
2599
* |job|'s [=force bypass cache flag=] is set.
2594
2600
* |newestWorker| is not null, and |registration|'s [=last update check time=] is not null and the time difference in seconds calculated by the current time minus |registration|’s [=last update check time=] is greater than 86400.
2595
2601
2596
2602
Note: Even if the cache mode is not set to "<code>no-cache</code>", the user agent obeys Cache-Control header's max-age value in the network layer to determine if it should bypass the browser cache.
2597
2603
2598
-
1. Set |request|'s [=skip-service-worker flag=].
2604
+
1. Set |request|'s [=service-workers mode=] to "`none`".
2599
2605
1. If the [=fetching scripts/is top-level=] flag is unset, then return the result of [=/fetching=] |request|.
2600
2606
1. Append \`<code>Service-Worker</code>\`/\`<code>script</code>\` to |request|'s [=request/header list=].
1. Let |preloadRequestHeaders| be |preloadRequest|'s [=request/header list=].
2910
2916
1. Let |preloadResponseObject| be a new {{Response}} object associated with a new {{Headers}} object whose [=guard=] is "`immutable`".
2911
2917
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=].
2912
-
1. Set |preloadRequest|'s [=skip-service-worker flag=].
2918
+
1. Set |preloadRequest|'s [=service-workers mode=] to "`none`".
0 commit comments