diff --git a/docs/index.bs b/docs/index.bs index 2e63c955..2e37a34d 100644 --- a/docs/index.bs +++ b/docs/index.bs @@ -61,6 +61,7 @@ spec: html; type: dfn text: browsing context text: discard a document text: document base url + text: environment text: environment settings object text: event handler text: event handler event type @@ -217,11 +218,13 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/ urlPrefix: semantics.html text: external resource link urlPrefix: webappapis.html + text: active service worker; for: environment text: classic script text: creation url text: dom manipulation task source text: fire a simple event text: https state; for: environment settings object + text: id; for: environment text: module script text: realm execution context text: referrer policy; for: environment settings object; url: concept-settings-object-referrer-policy @@ -258,9 +261,10 @@ spec: page-visibility; urlPrefix: https://www.w3.org/TR/page-visibility/ type: enum; text: VisibilityState; url: VisibilityState type: attribute; text: visibilityState; for: Document; url: dom-document-visibilitystate -spec: powerful-features; urlPrefix: https://w3c.github.io/webappsec/specs/powerfulfeatures/# +spec: secure-contexts; urlPrefix: https://w3c.github.io/webappsec-secure-contexts/# type: dfn text: is origin potentially trustworthy; url: is-origin-trustworthy + text: potentially trustworthy url; url: potentially-trustworthy-url text: risks associated with insecure contexts; url: threat-risks text: secure context @@ -379,11 +383,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/

Service Worker Client

-

A service worker client is a type of environment settings object.

- -

A service worker client has an associated active worker (an active worker) which currently controls it. It is initially set to null.

- -

A service worker client has an associated id (an opaque string), which uniquely identifies itself during its lifetime. It is initially set to a new unique value when the corresponding environment settings object that it represents is created.

+

A service worker client is a type of environment or environment settings object.

A service worker client has an associated frame type, which is one of auxiliary, top-level, nested, and none. Unless stated otherwise it is none. @@ -638,7 +638,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/

-

The {{ServiceWorkerRegistration/unregister()}} method unregisters the service worker registration. It is important to note that the currently controlled service worker client's active worker's containing service worker registration is effective until all the service worker clients (including itself) using this service worker registration unload. That is, the {{ServiceWorkerRegistration/unregister()}} method only affects subsequent navigations.

+

The {{ServiceWorkerRegistration/unregister()}} method unregisters the service worker registration. It is important to note that the currently controlled service worker client's active service worker's containing service worker registration is effective until all the service worker clients (including itself) using this service worker registration unload. That is, the {{ServiceWorkerRegistration/unregister()}} method only affects subsequent navigations.

unregister() method must run these steps:

@@ -734,7 +734,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
  1. Let client be the context object's service worker client.
  2. -
  3. Return the {{ServiceWorker}} object that represents client's active worker.
  4. +
  5. Return the {{ServiceWorker}} object that represents client's active service worker.

{{ServiceWorkerContainer/controller|navigator.serviceWorker.controller}} returns null if the request is a force refresh (shift+refresh). The {{ServiceWorker}} objects returned from this attribute getter that represent the same service worker are the same objects.

@@ -992,7 +992,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/ controllerchange {{Event}} - The service worker client's active worker changes. (See step 9.2 of the Activate algorithm. The skip waiting flag of a service worker causes activation of the service worker registration to occur while service worker clients are using the service worker registration, {{ServiceWorkerContainer/controller|navigator.serviceWorker.controller}} immediately reflects the active worker as the service worker that controls the service worker client.) + The service worker client's active service worker changes. (See step 9.2 of the Activate algorithm. The skip waiting flag of a service worker causes activation of the service worker registration to occur while service worker clients are using the service worker registration, {{ServiceWorkerContainer/controller|navigator.serviceWorker.controller}} immediately reflects the active worker as the service worker that controls the service worker client.) message @@ -1213,7 +1213,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/

{{Client/id}}

-

The id attribute must return its associated service worker client's id.

+

The id attribute must return its associated service worker client's id.

@@ -1293,7 +1293,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
  • Let url be the result of parsing url with the context object's relevant settings object's API base URL.
  • If url is failure, return a promise rejected with a TypeError.
  • If url is about:blank, return a promise rejected with a TypeError.
  • -
  • If the context object's associated service worker client's active worker is not the context object's relevant global object's service worker, return a promise rejected with a TypeError.
  • +
  • If the context object's associated service worker client's active service worker is not the context object's relevant global object's service worker, return a promise rejected with a TypeError.
  • Let promise be a new promise.
  • Run these substeps in parallel:
      @@ -1368,7 +1368,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
      1. For each service worker client client whose origin is the same as the associated service worker's origin:
          -
        1. If client's id is id, then: +
        2. If client's id is id, then:
          1. If client is not a secure context, reject promise with a "{{SecurityError}}" exception and abort these steps.
          2. If client is a window client, then: @@ -1419,7 +1419,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
          3. If client is not a secure context, continue to the next iteration of the loop.
          4. If options.{{ClientQueryOptions/includeUncontrolled}} is false, then:
              -
            1. If client's active worker is the associated service worker, add client to targetClients.
            2. +
            3. If client's active service worker is the associated service worker, add client to targetClients.
          5. Else: @@ -3603,7 +3603,8 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
          6. Set headersObject's guard to immutable.
          7. Let response be null.
          8. Let registration be null.
          9. -
          10. Let client be the service worker client that corresponds to request's client.
          11. +
          12. Let client be request's client.
          13. +
          14. Let reservedClient be request's reserved client.
          15. Assert: request's destination is not "serviceworker".
          16. If request is a potential-navigation-or-subresource request, then:
              @@ -3613,17 +3614,26 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
            1. Else if request is a non-subresource request, then:

              If the non-subresource request is under the scope of a service worker registration, application cache is completely bypassed regardless of whether the non-subresource request uses the service worker registration.

                -
              1. If client is not a secure context, return null.
              2. +
              3. If reservedClient is not null and is an environment settings object, then: +
                  +
                1. If reservedClient is not a secure context, return null.
                2. +
                +
              4. +
              5. Else: +
                  +
                1. If request's url is not a potentially trustworthy URL, return null.
                2. +
                +
              6. If request is a navigation request and the navigation triggering it was initiated with a shift+reload or equivalent, return null.
              7. Set registration to the result of running Match Service Worker Registration algorithm passing request's url as the argument.
              8. If registration is null or registration's active worker is null, return null.
              9. -
              10. Set client's active worker to registration's active worker.
              11. +
              12. If request's destination is not "report", set reservedClient's active service worker to registration's active worker.
              -

              From this point, the service worker client starts to use its active worker's containing service worker registration.

              +

              From this point, the service worker client starts to use its active service worker's containing service worker registration.

            2. Else if request is a subresource request, then:
                -
              1. If client's active worker is non-null, set registration to client's active worker's containing service worker registration.
              2. +
              3. If client's active service worker is non-null, set registration to client's active service worker's containing service worker registration.
              4. Else, return null.
            3. @@ -3637,7 +3647,9 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/
              1. Create a trusted event e that uses the {{FetchEvent}} interface, with the event type fetch, which does not bubble.
              2. Let the request attribute of e be initialized to r.
              3. -
              4. Let the clientId attribute of e be initialized to client's id if request is not a non-subresource request, and to null otherwise.
              5. +
              6. Initialize e's clientId attribute to client's id.
              7. +
              8. If request is a non-subresource request and request's destination is not "report", initialize e's reservedClientId attribute to reservedClient's id, and to null otherwise.
              9. +
              10. If request is a navigation request, initialize e's targetClientId attribute to request's target client id, and to null otherwise.
              11. Let the isReload attribute of e be initialized to true if request's client is a window client and the event was dispatched with the user's intention for the page reload, and false otherwise.
              12. Dispatch e at activeWorker's environment settings object's global object.
              13. If e's respond-with entered flag is set, set respondWithEntered to true.
              14. diff --git a/docs/index.html b/docs/index.html index 688d3d5a..645cd85b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1422,7 +1422,7 @@

                Service Workers Nightly

                -

                Editor’s Draft,

                +

                Editor’s Draft,

                This version: @@ -1789,21 +1789,19 @@

                2.3. Service Worker Client

                -

                A service worker client is a type of environment settings object.

                -

                A service worker client has an associated active worker (an active worker) which currently controls it. It is initially set to null.

                -

                A service worker client has an associated id (an opaque string), which uniquely identifies itself during its lifetime. It is initially set to a new unique value when the corresponding environment settings object that it represents is created.

                -

                A service worker client has an associated frame type, which is one of auxiliary, top-level, nested, and none. Unless stated otherwise it is none.

                -

                A window client is a service worker client whose global object is a Window object.

                -

                A dedicated worker client is a service worker client whose global object is a DedicatedWorkerGlobalScope object.

                -

                A shared worker client is a service worker client whose global object is a SharedWorkerGlobalScope object.

                +

                A service worker client is a type of environment or environment settings object.

                +

                A service worker client has an associated frame type, which is one of auxiliary, top-level, nested, and none. Unless stated otherwise it is none.

                +

                A window client is a service worker client whose global object is a Window object.

                +

                A dedicated worker client is a service worker client whose global object is a DedicatedWorkerGlobalScope object.

                +

                A shared worker client is a service worker client whose global object is a SharedWorkerGlobalScope object.

                A worker client is either a dedicated worker client or a shared worker client.

  • 2.4. Selection and Use

    -

    A service worker client independently selects and uses a service worker registration for its own loading and its subresources. The selection of a service worker registration, upon a non-subresource request, is a process of either matching a service worker registration from scope to registration map or inheriting an existing service worker registration from its parent or owner context depending on the request’s url.

    -

    When the request’s url is not local, a service worker client matches a service worker registration from scope to registration map. That is, the service worker client attempts to consult a service worker registration whose scope url matches its creation url.

    -

    When the request’s url is local, if the service worker client’s responsible browsing context is a nested browsing context or the service worker client is a worker client, the service worker client inherits the service worker registration from its parent browsing context’s environment or one of the worker’s Documents' environment, respectively, if it exists.

    -

    If the selection was successful, the selected service worker registration’s active worker starts to control the service worker client. Otherwise, the flow returns to fetch where it falls back to the default behavior. When a service worker client is controlled by an active worker, it is considered that the service worker client is using the active worker’s containing service worker registration.

    +

    A service worker client independently selects and uses a service worker registration for its own loading and its subresources. The selection of a service worker registration, upon a non-subresource request, is a process of either matching a service worker registration from scope to registration map or inheriting an existing service worker registration from its parent or owner context depending on the request’s url.

    +

    When the request’s url is not local, a service worker client matches a service worker registration from scope to registration map. That is, the service worker client attempts to consult a service worker registration whose scope url matches its creation url.

    +

    When the request’s url is local, if the service worker client’s responsible browsing context is a nested browsing context or the service worker client is a worker client, the service worker client inherits the service worker registration from its parent browsing context’s environment or one of the worker’s Documents' environment, respectively, if it exists.

    +

    If the selection was successful, the selected service worker registration’s active worker starts to control the service worker client. Otherwise, the flow returns to fetch where it falls back to the default behavior. When a service worker client is controlled by an active worker, it is considered that the service worker client is using the active worker’s containing service worker registration.

    2.5. Task Sources

    @@ -1822,7 +1820,7 @@

    A user agent must maintain the state of its stored service worker registrations across restarts with the following rules:

    To attain this, the user agent must invoke Handle User Agent Shutdown when it terminates.

    @@ -1983,7 +1981,7 @@

    -

    The unregister() method unregisters the service worker registration. It is important to note that the currently controlled service worker client’s active worker’s containing service worker registration is effective until all the service worker clients (including itself) using this service worker registration unload. That is, the unregister() method only affects subsequent navigations.

    +

    The unregister() method unregisters the service worker registration. It is important to note that the currently controlled service worker client’s active service worker’s containing service worker registration is effective until all the service worker clients (including itself) using this service worker registration unload. That is, the unregister() method only affects subsequent navigations.

    unregister() method must run these steps:

    1. Let p be a promise. @@ -2046,7 +2044,7 @@

      The user agent must create a ServiceWorkerContainer object when a Navigator object or a WorkerNavigator object is created and associate it with that object.

      A ServiceWorkerContainer provides capabilities to register, unregister, and update the service worker registrations, and provides access to the state of the service worker registrations and their associated service workers.

      -

      A ServiceWorkerContainer has an associated service worker client, which is a service worker client whose global object is associated with the Navigator object or the WorkerNavigator object that the ServiceWorkerContainer is retrieved from.

      +

      A ServiceWorkerContainer has an associated service worker client, which is a service worker client whose global object is associated with the Navigator object or the WorkerNavigator object that the ServiceWorkerContainer is retrieved from.

      A ServiceWorkerContainer object has an associated ready promise (a promise). It is initially set to a new promise.

      A ServiceWorkerContainer object has a task source called the client message queue, initially empty. A client message queue can be enabled or disabled, and is initially disabled. When a ServiceWorkerContainer object’s client message queue is enabled, the event loop must use it as one of its task sources. When the ServiceWorkerContainer object’s relevant global object is a Window object, all tasks queued on its client message queue must be associated with its relevant settings object’s responsible document.

      @@ -2054,7 +2052,7 @@
      @@ -2081,13 +2079,13 @@

  • Return context object’s ready promise. -

    When the ready attribute is accessed, the returned promise will never reject. Instead, it waits until the promise resolves with a service worker registration that has an active worker.

    +

    When the ready attribute is accessed, the returned promise will never reject. Instead, it waits until the promise resolves with a service worker registration that has an active worker.

  • @@ -2253,7 +2251,7 @@

    controllerchange Event - The service worker client’s active worker changes. (See step 9.2 of the Activate algorithm. The skip waiting flag of a service worker causes activation of the service worker registration to occur while service worker clients are using the service worker registration, navigator.serviceWorker.controller immediately reflects the active worker as the service worker that controls the service worker client.) + The service worker client’s active service worker changes. (See step 9.2 of the Activate algorithm. The skip waiting flag of a service worker causes activation of the service worker registration to occur while service worker clients are using the service worker registration, navigator.serviceWorker.controller immediately reflects the active worker as the service worker that controls the service worker client.) message ServiceWorkerMessageEvent @@ -2320,7 +2318,7 @@

    A ServiceWorkerGlobalScope object represents the global execution context of a service worker. A ServiceWorkerGlobalScope object has an associated service worker (a service worker).

    -

    ServiceWorkerGlobalScope object provides generic, event-driven, time-limited script execution contexts that run at an origin. Once successfully registered, a service worker is started, kept alive and killed by their relationship to events, not service worker clients. Any type of synchronous requests must not be initiated inside of a service worker.

    +

    ServiceWorkerGlobalScope object provides generic, event-driven, time-limited script execution contexts that run at an origin. Once successfully registered, a service worker is started, kept alive and killed by their relationship to events, not service worker clients. Any type of synchronous requests must not be initiated inside of a service worker.

    4.1.1. clients

    clients attribute must return the Clients object that is associated with the context object.

    @@ -2331,7 +2329,7 @@

    4.1.3. skipWaiting()

    -

    The skipWaiting() method allows this service worker to progress from the registration’s waiting position to active even while service worker clients are using the registration.

    +

    The skipWaiting() method allows this service worker to progress from the registration’s waiting position to active even while service worker clients are using the registration.

    skipWaiting() method must run these steps:

    1. Let promise be a new promise. @@ -2401,7 +2399,7 @@

      4.2 "none" }; -

      A Client object has an associated service worker client (a service worker client).

      +

      A Client object has an associated service worker client (a service worker client).

      A WindowClient object has an associated visibility state, which is one of visibilityState attribute value.

      A WindowClient object has an associated focus state, which is either true or false (initially false).

      @@ -2430,7 +2428,7 @@

      4.2.3. id

      -

      The id attribute must return its associated service worker client’s id.

      +

      The id attribute must return its associated service worker client’s id.

      4.2.4. postMessage(message, transfer)

      @@ -2497,7 +2495,7 @@

      Let url be the result of parsing url with the context object’s relevant settings object’s API base URL.
    2. If url is failure, return a promise rejected with a TypeError.
    3. If url is about:blank, return a promise rejected with a TypeError. -
    4. If the context object’s associated service worker client’s active worker is not the context object’s relevant global object’s service worker, return a promise rejected with a TypeError. +
    5. If the context object’s associated service worker client’s active service worker is not the context object’s relevant global object’s service worker, return a promise rejected with a TypeError.
    6. Let promise be a new promise.
    7. Run these substeps in parallel: @@ -2563,12 +2561,12 @@

      in parallel:
      1. - For each service worker client client whose origin is the same as the associated service worker’s origin: + For each service worker client client whose origin is the same as the associated service worker’s origin:
        1. - If client’s id is id, then: + If client’s id is id, then:
            -
          1. If client is not a secure context, reject promise with a "SecurityError" exception and abort these steps. +
          2. If client is not a secure context, reject promise with a "SecurityError" exception and abort these steps.
          3. If client is a window client, then:
              @@ -2608,13 +2606,13 @@

              service worker client client whose origin is the same as the associated service worker’s origin: + For each service worker client client whose origin is the same as the associated service worker’s origin:
                -
              1. If client is not a secure context, continue to the next iteration of the loop. +
              2. If client is not a secure context, continue to the next iteration of the loop.
              3. If options.includeUncontrolled is false, then:
                  -
                1. If client’s active worker is the associated service worker, add client to targetClients. +
                2. If client’s active service worker is the associated service worker, add client to targetClients.
              4. Else: @@ -2624,7 +2622,7 @@

                service worker client client in targetClients, in the most recently focused order for window clients: + For each service worker client client in targetClients, in the most recently focused order for window clients:
                1. If options.type is "window", and client is a window client, then: @@ -2746,22 +2744,22 @@

                  4.3.4. claim()

                  The claim() method must run these steps:

                    -
                  1. If the service worker is not an active worker, return a promise rejected with an "InvalidStateError" exception. +
                  2. If the service worker is not an active worker, return a promise rejected with an "InvalidStateError" exception.
                  3. Let promise be a new promise.
                  4. Run the following substeps in parallel:
                    1. - For each service worker client client whose origin is the same as the service worker’s origin: + For each service worker client client whose origin is the same as the service worker’s origin:
                        -
                      1. If client is not a secure context, continue to the next iteration of the loop. +
                      2. If client is not a secure context, continue to the next iteration of the loop.
                      3. Let registration be the result of running Match Service Worker Registration algorithm passing client’s creation url as the argument.
                      4. If registration is not the service worker’s containing service worker registration, continue to the next iteration of the loop.
                      5. - If client’s active worker is not the service worker, then: + If client’s active worker is not the service worker, then:
                        1. Invoke Handle Service Worker Client Unload with client as the argument. -
                        2. Set client’s active worker to service worker. +
                        3. Set client’s active worker to service worker.
                        4. Invoke Notify Controller Change algorithm with client as the argument.
                      @@ -2818,7 +2816,7 @@

                      Service workers define the following behaviors for install event and activate event, respectively:

    8. @@ -3167,7 +3165,7 @@

      4.8.2. event.origin

      -

      The origin attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to the empty string. It represents the origin of the service worker client that sent the message.

      +

      The origin attribute must return the value it was initialized to. When the object is created, this attribute must be initialized to the empty string. It represents the origin of the service worker client that sent the message.

      4.8.3. event.lastEventId

      @@ -3199,7 +3197,7 @@

      activate ExtendableEvent - [Lifecycle event] The service worker’s containing service worker registration’s active worker changes. (See step 12.2 of the Activate algorithm.) + [Lifecycle event] The service worker’s containing service worker registration’s active worker changes. (See step 12.2 of the Activate algorithm.) fetch FetchEvent @@ -3224,9 +3222,9 @@

  • Wait for task to have executed or been discarded, or the script to have been aborted by the termination of activeWorker.
  • Wait for the step labeled WaitForAsynchronousExtensions to complete. -
  • Run the Update Worker State algorithm passing registration’s active worker and activated as the arguments. +
  • Run the Update Worker State algorithm passing registration’s active worker and activated as the arguments.
  • @@ -4476,7 +4474,7 @@

    API base URL
    Return serviceWorker’s script url.
    The origin -
    Return its registering service worker client’s origin. +
    Return its registering service worker client’s origin.
    The creation URL
    Return workerGlobalScope’s url.
    The HTTPS state @@ -4487,7 +4485,7 @@

    referrer policy to serviceWorker’s script resource’s referrer policy.
  • Set workerGlobalScope’s type to serviceWorker’s type.
  • Create a new WorkerLocation object and associate it with workerGlobalScope. -
  • If serviceWorker is an active worker, and there are any tasks queued in serviceWorker’s containing service worker registration’s task queues, queue them to serviceWorker’s event loop’s task queues in the same order using their original task sources. +
  • If serviceWorker is an active worker, and there are any tasks queued in serviceWorker’s containing service worker registration’s task queues, queue them to serviceWorker’s event loop’s task queues in the same order using their original task sources.
  • If script is a classic script, then run the classic script script. Otherwise, it is a module script; run the module script script.

    In addition to the usual possibilities of returning a value or failing due to an exception, this could be prematurely aborted by the kill a worker or terminate a worker algorithms.

    @@ -4539,7 +4537,8 @@

    guard to immutable.
  • Let response be null.
  • Let registration be null. -
  • Let client be the service worker client that corresponds to request’s client. +
  • Let client be request’s client. +
  • Let reservedClient be request’s reserved client.
  • Assert: request’s destination is not "serviceworker".
  • If request is a potential-navigation-or-subresource request, then: @@ -4550,20 +4549,29 @@

    non-subresource request, then:

    If the non-subresource request is under the scope of a service worker registration, application cache is completely bypassed regardless of whether the non-subresource request uses the service worker registration.

      -
    1. If client is not a secure context, return null. +
    2. + If reservedClient is not null and is an environment settings object, then: +
        +
      1. If reservedClient is not a secure context, return null. +
      +
    3. + Else: +
        +
      1. If request’s url is not a potentially trustworthy URL, return null. +
    4. If request is a navigation request and the navigation triggering it was initiated with a shift+reload or equivalent, return null.
    5. Set registration to the result of running Match Service Worker Registration algorithm passing request’s url as the argument. -
    6. If registration is null or registration’s active worker is null, return null. -
    7. Set client’s active worker to registration’s active worker. +
    8. If registration is null or registration’s active worker is null, return null. +
    9. If request’s destination is not "report", set reservedClient’s active service worker to registration’s active worker.
    -

    From this point, the service worker client starts to use its active worker’s containing service worker registration.

    +

    From this point, the service worker client starts to use its active service worker’s containing service worker registration.

  • Else if request is a subresource request, then:
      -
    1. If client’s active worker is non-null, set registration to client’s active worker’s containing service worker registration. +
    2. If client’s active service worker is non-null, set registration to client’s active service worker’s containing service worker registration.
    3. Else, return null.
    -
  • Let activeWorker be registration’s active worker. +
  • Let activeWorker be registration’s active worker.
  • If activeWorker’s set of event types to handle does not contain fetch, return null.

    To avoid unnecessary delays, the Handle Fetch enforces early return when no event listeners have been deterministically added in the service worker’s global during the very first script execution.

    @@ -4574,7 +4582,9 @@

    trusted event e that uses the FetchEvent interface, with the event type fetch, which does not bubble.
  • Let the request attribute of e be initialized to r. -
  • Let the clientId attribute of e be initialized to client’s id if request is not a non-subresource request, and to null otherwise. +
  • Initialize e’s clientId attribute to client’s id. +
  • If request is a non-subresource request and request’s destination is not "report", initialize e’s reservedClientId attribute to reservedClient’s id, and to null otherwise. +
  • If request is a navigation request, initialize e’s targetClientId attribute to request’s target client id, and to null otherwise.
  • Let the isReload attribute of e be initialized to true if request’s client is a window client and the event was dispatched with the user’s intention for the page reload, and false otherwise.
  • Dispatch e at activeWorker’s environment settings object’s global object.
  • If e’s respond-with entered flag is set, set respondWithEntered to true. @@ -4628,7 +4638,7 @@

    If request is not a subresource request, return null and abort these steps.

    Foreign fetch only allows intercepting of subresource requests. Navigation requests can be intercepted by the regular fetch event anyway, so there is no benefit to supporting those requests here as well.

    -
  • If request’s client is not a secure context, return null and abort these steps. +
  • If request’s client is not a secure context, return null and abort these steps.
  • Let activeWorker be the result of running the Match Service Worker for Foreign Fetch algorithm passing request’s url as the argument.
  • If activeWorker is null, return null.
  • @@ -4719,8 +4729,8 @@

    Assert: a Record with the [[value]] equals to registration is contained in scope to registration map. -
  • Assert: registration’s active worker is not null. -
  • Let activeWorker be registration’s active worker. +
  • Assert: registration’s active worker is not null. +
  • Let activeWorker be registration’s active worker.
  • If activeWorker’s set of event types to handle does not contain the event type for this functional event, return.

    To avoid unnecessary delays, the Handle Functional Event enforces early return when no event listeners have been deterministically added in the service worker’s global during the very first script execution.

    @@ -4735,10 +4745,10 @@

    Handle Service Worker Client Unload

    -

    The user agent must run these steps when a service worker client unloads by unloading, being killed, or terminating.

    +

    The user agent must run these steps when a service worker client unloads by unloading, being killed, or terminating.

    Input -
    client, a service worker client +
    client, a service worker client
    Output
    None
    @@ -4746,7 +4756,7 @@

    service worker registration used by client.
  • If registration is null, abort these steps. -
  • If any other service worker client is using registration, abort these steps. +
  • If any other service worker client is using registration, abort these steps.
  • If registration’s uninstalling flag is set, invoke Clear Registration algorithm passing registration as its argument and abort these steps.
  • If registration’s waiting worker is not null, run Activate algorithm with registration as the argument. @@ -4803,7 +4813,7 @@

    Unre
  • Set registration’s uninstalling flag.
  • Invoke Resolve Job Promise with job and true.
  • - If no service worker client is using registration, invoke Clear Registration algorithm passing registration as its argument. + If no service worker client is using registration, invoke Clear Registration algorithm passing registration as its argument.

    When the registration is being used for a client, the deletion of the registration is handled by the Handle Service Worker Client Unload algorithm.

  • Invoke Finish Job with job. @@ -4854,9 +4864,9 @@

    Update Worker State algorithm passing redundantWorker and redundant as the arguments.
  • - If registration’s active worker is not null, then: + If registration’s active worker is not null, then:
      -
    1. Set redundantWorker to registration’s active worker. +
    2. Set redundantWorker to registration’s active worker.
    3. Terminate redundantWorker.
    4. The user agent may abort in-flight requests triggered by redundantWorker.
    5. Run the Update Registration State algorithm passing registration, "active" and null as the arguments. @@ -4900,11 +4910,11 @@

      Else if target is "active", then:
        -
      1. Set registration’s active worker to source. +
      2. Set registration’s active worker to source.
      3. For each registrationObject in registrationObjects:
          -
        1. Queue a task to set the active attribute of registrationObject to the ServiceWorker object that represents registration’s active worker, or null if registration’s active worker is null. +
        2. Queue a task to set the active attribute of registrationObject to the ServiceWorker object that represents registration’s active worker, or null if registration’s active worker is null.

      The task must use registrationObject’s relevant settings object’s responsible event loop and the DOM manipulation task source.

      @@ -4942,11 +4952,11 @@

      Up
      activating
      "activating" -

      The service worker in this state is considered an active worker. During this state, event.waitUntil(f) can be called inside the onactivate event handler to extend the life of the active worker until the passed promise resolves successfully. No functional events are dispatched until the state becomes activated.

      +

      The service worker in this state is considered an active worker. During this state, event.waitUntil(f) can be called inside the onactivate event handler to extend the life of the active worker until the passed promise resolves successfully. No functional events are dispatched until the state becomes activated.

      activated
      "activated" -

      The service worker in this state is considered an active worker ready to handle functional events.

      +

      The service worker in this state is considered an active worker ready to handle functional events.

      redundant
      "redundant" @@ -4962,7 +4972,7 @@

      Up

      Notify Controller Change

      Input -
      client, a service worker client +
      client, a service worker client
      Output
      None
      @@ -5006,7 +5016,7 @@

      Run the following steps atomically.
    6. Let registration be the result of running the Match Service Worker Registration algorithm passing requestURL as the argument.
    7. If registration is null, return null. -
    8. Let worker be registration’s active worker. +
    9. Let worker be registration’s active worker.
    10. If worker is null, return null.
    11. Let requestURLString be the serialized requestURL.
    12. @@ -5052,7 +5062,7 @@

      installing worker is not null, set newestWorker to registration’s installing worker.
    13. Else if registration’s waiting worker is not null, set newestWorker to registration’s waiting worker. -
    14. Else if registration’s active worker is not null, set newestWorker to registration’s active worker. +
    15. Else if registration’s active worker is not null, set newestWorker to registration’s active worker.
    16. Return newestWorker.
  • @@ -5060,7 +5070,7 @@

    Create Client

    Input -
    client, a service worker client +
    client, a service worker client
    Output
    clientObject, a Client object
    @@ -5074,7 +5084,7 @@

    C

    Create Window Client

    Input -
    client, a service worker client +
    client, a service worker client
    visibilityState, a string
    focusState, a boolean
    Output @@ -5263,7 +5273,7 @@

    Service-Worker-Allowed`
    - Indicates the user agent will override the path restriction, which limits the maximum allowed scope url that the script can control, to the given value. + Indicates the user agent will override the path restriction, which limits the maximum allowed scope url that the script can control, to the given value.

    The value is a URL. If a relative URL is given, it is parsed against the script’s URL.

    @@ -5365,12 +5375,7 @@

    activating, in §3.1
  • "activating", in §3.1
  • active, in §3.2.3 -
  • - active worker - +
  • active worker, in §2.2
  • addAll(requests), in §6.4.4
  • add(request), in §6.4.3
  • all, in §4.3 @@ -5458,7 +5463,6 @@

    dfn for service worker, in §2.1 -
  • dfn for service worker client, in §2.3
  • attribute for Client, in §4.2.3
  • ignoreMethod, in §6.4 @@ -5837,7 +5841,8 @@

    get(name)
  • guard
  • header -
  • header list +
  • header list (for request) +
  • header list (for response)
  • headers
  • http fetch
  • https state @@ -5862,8 +5867,10 @@

    read all bytes
  • readablestream
  • redirect mode -
  • request -
  • response +
  • request (for fetch) +
  • request (for request) +
  • response (for fetch) +
  • response (for response)
  • response tainting
  • skip service worker flag
  • status @@ -5896,6 +5903,7 @@

    a browsing context is discarded
  • about:blank
  • active document +
  • active service worker
  • api base url
  • api url character encoding
  • application cache @@ -5920,7 +5928,8 @@

    global object
  • has focus steps
  • href -
  • https state +
  • https state (for environment settings object) +
  • https state (for workerglobalscope)
  • import scripts into worker global scope
  • importScripts(urls)
  • in parallel @@ -5939,7 +5948,8 @@

    perform the fetch
  • queue a task
  • realm execution context -
  • referrer policy +
  • referrer policy (for environment settings object) +
  • referrer policy (for workerglobalscope)
  • relevant global object
  • relevant realm
  • relevant settings object @@ -5978,13 +5988,6 @@

    VisibilityState
  • visibilityState -
  • - [secure-contexts] defines the following terms: -
  • [promises-guide] defines the following terms:
      @@ -6014,6 +6017,14 @@

    • vary
    +
  • + [secure-contexts] defines the following terms: +
  • [WHATWG-URL] defines the following terms: - - - - -