diff --git a/spec/service_worker/index.bs b/spec/service_worker/index.bs index b2bf72ca..4cf4448a 100644 --- a/spec/service_worker/index.bs +++ b/spec/service_worker/index.bs @@ -325,7 +325,7 @@ spec: webidl; urlPrefix: https://heycam.github.io/webidl/

Model

-
+

Service Worker

A service worker is a type of web worker. A service worker executes in the registering service worker client's origin.

diff --git a/spec/service_worker/index.html b/spec/service_worker/index.html index cc36d349..9a5e0c74 100644 --- a/spec/service_worker/index.html +++ b/spec/service_worker/index.html @@ -1409,7 +1409,7 @@

Service Workers Nightly

-

Editor’s Draft,

+

Editor’s Draft,

This version: @@ -1734,20 +1734,20 @@

2. Model

2.1. Service Worker

-

A service worker is a type of web worker. A service worker executes in the registering service worker client’s origin.

-

A service worker has an associated state, which is one of parsed, installing, installed, activating, activated, and redundant. It is initially parsed.

-

A service worker has an associated script url (a URL).

-

A service worker has an associated type which is either "classic" or "module". Unless stated otherwise, it is "classic".

-

A service worker has an associated containing service worker registration (a service worker registration), which contains itself.

-

A service worker has an associated id (an opaque string), which uniquely identifies itself during the lifetime of its containing service worker registration.

-

A service worker is dispatched a set of lifecycle events, install and activate, and functional events including fetch.

-

A service worker has an associated script resource (a script), which represents its own script resource. It is initially set to null. A script resource has an associated has ever been evaluated flag. It is initially unset. A script resource has an associated HTTPS state which is "none", "deprecated", or "modern". Unless stated otherwise, it is "none".

-

A service worker has an associated script resource map which is a List of the Record {[[key]], [[value]]} where [[key]] is a URL and [[value]] is a response.

-

A service worker has an associated skip waiting flag. Unless stated otherwise it is unset.

-

A service worker has an associated imported scripts updated flag. It is initially unset.

-

A service worker has an associated set of event types to handle whose element type is an event listener’s event type. It is initially set to null.

-

A service worker has an associated list of foreign fetch scopes whose element type is a URL. It is initially empty.

-

A service worker has an associated list of foreign fetch origins whose element type is a URL. It is initially empty.

+

A service worker is a type of web worker. A service worker executes in the registering service worker client’s origin.

+

A service worker has an associated state, which is one of parsed, installing, installed, activating, activated, and redundant. It is initially parsed.

+

A service worker has an associated script url (a URL).

+

A service worker has an associated type which is either "classic" or "module". Unless stated otherwise, it is "classic".

+

A service worker has an associated containing service worker registration (a service worker registration), which contains itself.

+

A service worker has an associated id (an opaque string), which uniquely identifies itself during the lifetime of its containing service worker registration.

+

A service worker is dispatched a set of lifecycle events, install and activate, and functional events including fetch.

+

A service worker has an associated script resource (a script), which represents its own script resource. It is initially set to null. A script resource has an associated has ever been evaluated flag. It is initially unset. A script resource has an associated HTTPS state which is "none", "deprecated", or "modern". Unless stated otherwise, it is "none".

+

A service worker has an associated script resource map which is a List of the Record {[[key]], [[value]]} where [[key]] is a URL and [[value]] is a response.

+

A service worker has an associated skip waiting flag. Unless stated otherwise it is unset.

+

A service worker has an associated imported scripts updated flag. It is initially unset.

+

A service worker has an associated set of event types to handle whose element type is an event listener’s event type. It is initially set to null.

+

A service worker has an associated list of foreign fetch scopes whose element type is a URL. It is initially empty.

+

A service worker has an associated list of foreign fetch origins whose element type is a URL. It is initially empty.

2.1.1. Lifetime

The lifetime of a service worker is tied to the execution lifetime of events and not references held by service worker clients to the ServiceWorker object.

@@ -1819,7 +1819,7 @@

3. Client Context

Bootstrapping with a ServiceWorker: -
// scope defaults to the path the script sits in
+
// scope defaults to the path the script sits in
 // "/" in this example
 navigator.serviceWorker.register("/serviceworker.js").then(
   function(registration) {
@@ -1862,7 +1862,7 @@ 

For example, consider a document created by a navigation to https://example.com/app.html which matches via the following registration call which has been previously executed:

-
// Script on the page https://example.com/app.html
+
// Script on the page https://example.com/app.html
 navigator.serviceWorker.register("/service_worker.js", { scope: "/" });
 

The value of navigator.serviceWorker.controller.scriptURL will be "https://example.com/service_worker.js".

@@ -2252,7 +2252,7 @@

4. Execution Context

Serving Cached Resources: -
// caching.js
+
// caching.js
 this.addEventListener("install", function(e) {
   e.waitUntil(
     // Open a cache of resources.
@@ -3245,10 +3245,10 @@ 

has more or less the same effect as a document being loaded in a secure context with the following link element:

-
<link rel="serviceworker" href="/js/sw.js" scope="/">
+
<link rel="serviceworker" href="/js/sw.js" scope="/">
 

which is more or less equivalent to the page containing javascript code like:

-
navigator.serviceworker.register("/js/sw.js", { scope: "/" });
+
navigator.serviceworker.register("/js/sw.js", { scope: "/" });
 

@@ -5249,7 +5249,7 @@

Default scope: -
// Maximum allowed scope defaults to the path the script sits in
+
// Maximum allowed scope defaults to the path the script sits in
 // "/js" in this example
 navigator.serviceWorker.register("/js/sw.js").then(function() {
   console.log("Install succeeded with the default scope '/js'.");
@@ -5258,7 +5258,7 @@ 

Upper path without Service-Worker-Allowed header: -
// Set the scope to an upper path of the script location
+
// Set the scope to an upper path of the script location
 // Response has no Service-Worker-Allowed header
 navigator.serviceWorker.register("/js/sw.js", { scope: "/" }).catch(function() {
   console.error("Install failed due to the path restriction violation.");
@@ -5267,7 +5267,7 @@ 

Upper path with Service-Worker-Allowed header: -
// Set the scope to an upper path of the script location
+
// Set the scope to an upper path of the script location
 // Response included "Service-Worker-Allowed : /"
 navigator.serviceWorker.register("/js/sw.js", { scope: "/" }).then(function() {
   console.log("Install succeeded as the max allowed scope was overriden to '/'.");
@@ -5276,7 +5276,7 @@ 

A path restriction voliation even with Service-Worker-Allowed header: -
// Set the scope to an upper path of the script location
+
// Set the scope to an upper path of the script location
 // Response included "Service-Worker-Allowed : /foo"
 navigator.serviceWorker.register("/foo/bar/sw.js", { scope: "/" }).catch(function() {
   console.error("Install failed as the scope is still out of the overriden maximum allowed scope.");