diff --git a/fetch.bs b/fetch.bs index 9288778b0..188ddd74e 100644 --- a/fetch.bs +++ b/fetch.bs @@ -745,26 +745,18 @@ explicitly set request's navigator.sendBeacon and the HTML img element set this flag. Requests with this flag set are subject to additional processing requirements. -

A request has an associated -service-workers mode, that is "all", -"foreign", or "none". Unless stated otherwise it is -"all". +

A request has an associated service-workers mode, that +is "all" or "none". Unless stated otherwise it is "all".

This determines which service workers will receive a {{fetch!!event}} event for this fetch.

"all" -
Relevant local and foreign service workers will get a {{fetch!!event}} or - {{foreignfetch!!event}} event for this fetch. - -
"foreign" -
Only relevant foreign service workers will get a {{foreignfetch!!event}} event for this fetch. - {{fetch(input)!!method}} uses this to bypass the current service worker if the global is a - {{ServiceWorkerGlobalScope}}. +
Relevant service workers will get a {{fetch!!event}} event for this fetch.
"none" -
Neither local nor foreign service workers will get events for this fetch. +
No service workers will get events for this fetch.
@@ -2887,23 +2879,11 @@ optional CORS flag and CORS-preflight flag, run these steps:
  • Let actualResponse be null.

  • -

    If request's service-workers mode is not "none", then run these - substeps: +

    If request's service-workers mode is "all", then:

      -
    1. -

      If request's service-workers mode is "all", then set - response to the result of invoking handle fetch for request. - [[!HTML]] [[!SW]] - -

    2. -

      If response is null, request is a subresource request, and - request's origin is not - same origin with request's - url's - origin, then set response - to the result of invoking handle foreign fetch for - request. [[!SW]] +

    3. Set response to the result of invoking handle fetch for + request. [[!HTML]] [[!SW]]

    4. If response is not null, then run these substeps: @@ -2983,9 +2963,8 @@ optional CORS flag and CORS-preflight flag, run these steps: CORS-preflight fetches.

    5. -

      If request's redirect mode is - "follow", then set request's service-workers mode to - "foreign". +

      If request's redirect mode is "follow", then set + request's service-workers mode to "none".

      Redirects coming from the network (as opposed to from a service worker) are not to be exposed to a service worker. @@ -5377,7 +5356,7 @@ method, must run these steps:

    6. If request's client's global object is a {{ServiceWorkerGlobalScope}} object, - set request's service-workers mode to "foreign". + then set request's service-workers mode to "none".
    7. Let responseObject be a new {{Response}} object and a new associated {{Headers}} object whose guard is