diff --git a/index.html b/index.html index 692c53c60..1b67b1cac 100644 --- a/index.html +++ b/index.html @@ -338,7 +338,7 @@

  1. Instantiate an installation process.
  2. -
  3. Let manifest be the result of obtaining the +
  4. Let manifest and manifest URL be the result of obtaining the manifest.
  5. If obtaining the manifest results in an error, a user @@ -346,6 +346,23 @@

    browsing context' Document's metadata to populate an installation process' UI.

  6. +
  7. If obtaining the manifest succeeds, and the result of running the + steps for processing the serviceworker member with manifest + returns a valid registration, a user agent can at this point +
      +
    1. Let client be the top-level browsing context' + Document's + + relevant settings object, or null if unavailable. +
    2. Invoke Start Register with scope and src + members of the registration, a new promise, + client, manifest URL, plus the type and use_cache + members of the registration, +
    3. +
    + in which case the state of the settled promise determines whether the + installation succeeded or not. +
  8. If the installation succeeded, queue a task on the application life-cycle task source to fire an event named appinstalled at the @@ -604,8 +621,8 @@

    A developer specifies the navigation scope via the - scope member. In the case where the - scope member is missing or in error, the navigation + scope member. In the case where the + scope member is missing or in error, the navigation scope is treated as unbounded (represented as the value undefined). In such a case, the manifest is applied to all URLs the application context is navigated to (see related @@ -1239,6 +1256,11 @@

    start_url member with manifest, manifest URL, and document URL as arguments.

  9. +
  10. Let service worker registration of parsed manifest + be the result of running the steps for processing the + serviceworker member with manifest, + manifest URL, and serviceworker as arguments. +
  11. Let display mode of parsed manifest be the result of running the steps for processing the display member with manifest as the @@ -2033,6 +2055,104 @@

    + +
    +

    + serviceworker member +

    +

    + The serviceworker member describes a + service worker as defined in [[!SERVICE-WORKERS-1]]. +

    +

    + The serviceworker member represents an intented + service worker registration in form of a registration object +

    +

    + Other service worker registrations can be done, for instance + by a script; if these have different scopes they will be considered separate + registrations. If they have the same scope and script URL, they coalesce. + If they have different script URLs, last one wins. +

    +

    + The steps for processing the serviceworker + member are given by the following algorithm. The algorithm + takes a manifest manifest. This algorithm returns a + registration object registration, which can be + undefined. +

    +
      +
    1. Let unprocessed registration be the result of calling the + [[\GetOwnProperty]] internal method of manifest + with argument "serviceworker". +
    2. Let src be the result of running the steps + for processing the src member of a service worker + with unprocessed registration and manifest URL. +
    3. +
    4. If src is undefined, or if the result of + running is origin potentially trustworthy + with the origin of src is Not Trusted, + issue a developer warning, abort these steps and return + undefined. +
    5. +
    6. Otherwise, let registration be an object with + properties src, scope, type and + use_cache. All properties initially set to + undefined. +
    7. +
    8. Set registration's src property to be + src. +
    9. +
    10. Let scope be the result of running the steps + for processing the scope member of a service worker + passing unprocessed registration. +
    11. +
    12. If scope is undefined, issue a developer + warning, abort these steps and return undefined. +
    13. +
    14. Otherwise, set registration's scope + property to be scope. +
    15. +
    16. Let type be the result of running the steps + for processing the type member of a service worker + passing unprocessed registration. +
    17. +
    18. If type is undefined, issue a developer + warning, abort these steps and return undefined. +
    19. +
    20. Otherwise, set registration's type + property to be type. +
    21. +
    22. Let use cache be the result of running the steps + for processing the use_cache member of a service worker + passing unprocessed registration. +
    23. +
    24. If use cache is undefined, issue a developer + warning, abort these steps and return undefined. +
    25. +
    26. Otherwise, set registration's use_cache + property to be use cache. +
    27. +
    28. Return registration. +
    29. +
    +
    + In the following example, the web application is listing + a service worker for the /foo scope, bypassing the user agent cache + when fetching the "sw.js" source: +
    +          "serviceworker": {
    +            "src": "sw.js",
    +            "scope": "/foo",
    +            "use_cache": false
    +          }
    +          
    +
    +
    + + +

    theme_color member @@ -2814,6 +2934,181 @@

+
+

+ The serviceworker object and its members +

+

+ A serviceworker object represents a service worker + registration for the web application. +

+
+

+ src member +

+

+ The src member of a + serviceworker object is a URL representing a + service worker. +

+

+ The steps for processing the src member of a + service worker are given by the following algorithm. The algorithm takes + a serviceworker object registration, and a URL manifest + URL, which is the URL from which the + manifest was fetched. This algorithm will return a + URL or undefined. +

+
    +
  1. Let value be the result of calling the + [[\GetOwnProperty]] internal method of registration + passing " src" as the argument. +
  2. +
  3. Let type be Type(value). +
  4. +
  5. If type is not "string", then: +
      +
    1. If type is not "undefined", issue a + developer warning that the type is unsupported. +
    2. +
    3. Return undefined. +
    4. +
    +
  6. +
  7. If Trim(value) is the empty string, then return + undefined. +
  8. +
  9. Otherwise, parse value using manifest + URL as the base URL and return the result. +
  10. +
+
+
+

+ scope member +

+

+ The scope member of a + serviceworker object is the service worker's associated + scope URL. +

+

+ The steps for processing the scope member of a + service worker are given by the following algorithm. The algorithm takes + a serviceworker object registration, and a URL manifest + URL, which is the URL from which the + manifest was fetched. This algorithm will return a + URL or undefined. +

+
    +
  1. Let value be the result of calling the + [[\GetOwnProperty]] internal method of registration + passing "scope" as the argument. +
  2. +
  3. Let type be Type(value). +
  4. +
  5. If type is not "string", then: +
      +
    1. If type is not "undefined", issue a + developer warning that the type is unsupported and + return undefined. +
    2. +
    3. Return null. +
    4. +
    +
  6. +
  7. If Trim(value) is the empty string, then return + undefined. +
  8. +
  9. Otherwise, parse value using manifest + URL as the base URL and return the result. +
  10. +
+
+
+

+ type member +

+

+ The type member of a + serviceworker object is the service worker's + worker type. +

+

+ The steps for processing the type member of a + service worker are given by the following algorithm. The algorithm takes + a serviceworker object registration, and a URL manifest + URL, which is the URL from which the + manifest was fetched. This algorithm will return a + string. +

+
    +
  1. Let value be the result of calling the + [[\GetOwnProperty]] internal method of registration + passing " type" as the argument. +
  2. +
  3. Let type be Type(value). +
  4. +
  5. If type is not "string", then: +
      +
    1. If type is not "undefined", issue a + developer warning that the type is unsupported and + return undefined. +
    2. +
    3. Return "classic". +
    4. +
    +
  6. +
  7. If Trim(value) is the empty string, then: +
      +
    1. Issue a developer warning that the type is unsupported. +
    2. +
    3. Return undefined. +
    4. +
    +
  8. Otherwise, Trim(value) and return the result. +
  9. +
+
+
+

+ use_cache member +

+

+ The use_cache member of a + serviceworker object determines whether the user agent + cache should + be used when fetching the service worker. +

+

+ The steps for processing the use_cache member of a + service worker are given by the following algorithm. The algorithm takes + a serviceworker object registration, and a URL manifest + URL, which is the URL from which the + manifest was fetched. This algorithm will return a + boolean. +

+
    +
  1. Let value be the result of calling the + [[\GetOwnProperty]] internal method of registration + passing " use_cache" as the argument. +
  2. +
  3. Let type be Type(value). +
  4. +
  5. If type is not "boolean", then: +
      +
    1. If type is not "undefined", issue a + developer warning that the type is unsupported and + return undefined. +
    2. +
    3. Otherwise, return false
    4. +
    +
  6. +
  7. Otherwise, return value. +
  8. +
+
+

Application object and its members @@ -2988,6 +3283,18 @@

default-src directives are defined in [[!CSP3]].

+

+ The + Is origin potentially trustworthy is defined in [[!SECURE-CONTEXTS]]. +

+

+ The Start Register + is defined in [[!SERVICE-WORKERS-1]]. +

+

+ The scope URL + is defined in [[!SERVICE-WORKERS-1]]. +

The IsStructurallyValidLanguageTag