diff --git a/docs/index.bs b/docs/index.bs index 633503c3..5814af24 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -164,6 +164,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe A script resource has an associated referrer policy (a [=/referrer policy=]). It is initially the empty string. + A [=/service worker=] has an associated embedder policy (an [=/embedder policy=]). + A [=/service worker=] has an associated script resource map which is an ordered map where the keys are [=/URLs=] and the values are [=/responses=]. A [=/service worker=] has an associated set of used scripts (a [=ordered set|set=]) whose [=list/item=] is a [=/URL=]. It is initially a new [=ordered set|set=]. @@ -1863,6 +1865,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe 1. Let |requestResponses| be the result of running [=Query Cache=] with |r| and |options|. 1. [=list/For each=] |requestResponse| of |requestResponses|: 1. Add a copy of |requestResponse|'s response to |responses|. + 1. [=list/For each=] |response| of |responses|: + 1. If |response|'s [=response/type=] is "`opaque`" and [=cross-origin resource policy check=] with |promise|'s [=relevant settings object=]'s [=environment settings object/origin=], |promise|'s [=relevant settings object=], and |response|'s [=internal/internal response=] returns blocked, then reject |promise| with a `TypeError` and abort these steps. 1. [=Queue a task=], on |promise|'s [=relevant settings object=]'s [=responsible event loop=] using the [=DOM manipulation task source=], to perform the following steps: 1. Let |responseList| be a [=list=]. 1. [=list/For each=] |response| of |responses|: @@ -2570,6 +2574,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe 1. Invoke Finish Job with |job| and abort these steps. 1. Let |httpsState| be "none". 1. Let |referrerPolicy| be the empty string. + 1. Let |embedder policy| be null. 1. Let |hasUpdatedResources| be false. 1. Let |updatedResourceMap| be an [=ordered map=] where the [=map/keys=] are [=/URLs=] and the [=map/values=] are [=/responses=]. 1. Switching on |job|'s [=worker type=], run these substeps with the following options: @@ -2609,6 +2614,7 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe 1. Set |httpsState| to |response|'s [=response/HTTPS state=]. 1. Set |referrerPolicy| to the result of parse a referrer policy from a Referrer-Policy header of |response|. + 1. Set |embedder policy| to the result of [=obtain an embedder policy|obtaining an embedder policy=] from |response|. 1. If |serviceWorkerAllowed| is failure, then: 1. Asynchronously complete these steps with a network error. 1. Let |scopeURL| be |registration|'s [=service worker registration/scope url=]. @@ -2677,6 +2683,8 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe 1. Append |url| to |worker|'s [=set of used scripts=]. 1. Set |worker|'s script resource's HTTPS state to |httpsState|. 1. Set |worker|'s script resource's [=script resource/referrer policy=] to |referrerPolicy|. + 1. Assert: |embedder policy| is not null. + 1. Set |worker|'s [=service worker/embedder policy=] to |embedder policy|. 1. Let |forceBypassCache| be true if |job|'s [=job/force bypass cache flag=] is set, and false otherwise. 1. Let |runResult| be the result of running the [=Run Service Worker=] algorithm with |worker| and |forceBypassCache|. 1. If |runResult| is *failure* or an [=abrupt completion=], then: @@ -2873,11 +2881,14 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe :: Return |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=]. : The [=environment settings object/referrer policy=] :: Return |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=]. + : The [=environment settings object/embedder policy=] + :: Return |workerGlobalScope|'s [=WorkerGlobalScope/embedder policy=]. 1. Set |settingsObject|'s [=environment/id=] to a new unique opaque string, its [=creation URL=] to |serviceWorker|'s [=service worker/script url=], its [=environment/target browsing context=] to null, and its [=active service worker=] to null. 1. Set |workerGlobalScope|'s [=WorkerGlobalScope/url=] to |serviceWorker|'s [=service worker/script url=]. 1. Set |workerGlobalScope|'s [=WorkerGlobalScope/HTTPS state=] to |serviceWorker|'s script resource's HTTPS state. 1. Set |workerGlobalScope|'s [=WorkerGlobalScope/referrer policy=] to |serviceWorker|'s script resource's [=script resource/referrer policy=]. + 1. Set |workerGlobalScope|'s [=WorkerGlobalScope/embedder policy=] to |serviceWorker|'s [=service worker/embedder policy=]. 1. Set |workerGlobalScope|'s [=WorkerGlobalScope/type=] to |serviceWorker|'s [=service worker/type=]. 1. Set |workerGlobalScope|'s [=ServiceWorkerGlobalScope/force bypass cache for import scripts flag=] if |forceBypassCache| is true. 1. Create a new {{WorkerLocation}} object and associate it with |workerGlobalScope|.