From 94df52252053f8893da0bf8984a00079b7b74d00 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 10 Nov 2021 19:45:43 -0500 Subject: [PATCH] Define background-sync as a default powerful feature. --- spec/index.bs | 6 + spec/index.html | 1926 ++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 1730 insertions(+), 202 deletions(-) diff --git a/spec/index.bs b/spec/index.bs index 82d7423..47e2beb 100644 --- a/spec/index.bs +++ b/spec/index.bs @@ -165,6 +165,12 @@ spec: WebIDL; urlPrefix: https://heycam.github.io/webidl/# Within one list of sync registrations each sync registration MUST have a unique tag. +
+

Permissions Integration

+ The Web Background Synchronization API is a [=default powerful feature=] that is identified by the + [=powerful feature/name=] "background-sync". +
+

Privacy Considerations

diff --git a/spec/index.html b/spec/index.html index 9519d16..5109260 100644 --- a/spec/index.html +++ b/spec/index.html @@ -3,10 +3,1334 @@ Web Background Synchronization + - + - + +
-

4. Privacy Considerations

+

4. Permissions Integration

+ The Web Background Synchronization API is a default powerful feature that is identified by the name "background-sync". +
+
+

5. Privacy Considerations

-

4.1. Permission

+

5.1. Permission

User agents MAY offer a way for the user to disable background sync.

Note: Background sync SHOULD be enabled by default. Having the permission denied is considered an exceptional case.

-

4.2. Location Tracking

+

5.2. Location Tracking

Fetch requests within the onsync event while in the background may reveal the client’s IP address to the server after the user left the page. The user agent SHOULD limit tracking by capping the number of retries and duration of sync events.
-

4.3. History Leaking

+

5.3. History Leaking

Fetch requests within the onsync event while in the background may reveal something about the client’s navigation history to passive eavesdroppers. For instance, the client might visit site https://example.com, which registers a sync event, but doesn’t fire until after the user has navigated away from the page and changed networks. Passive eavesdroppers on the new network may see the fetch requests that the onsync event makes. The fetch requests are HTTPS so the request contents will not be leaked but the domain may be (via DNS lookups and IP address of the request).
-

5. API Description

+

6. API Description

-

5.1. Extensions to the ServiceWorkerRegistration interface

+

6.1. Extensions to the ServiceWorkerRegistration interface

+
+ +
+

ServiceWorkerRegistration/sync

+

In only one current engine.

+
+ FirefoxNoneSafariNoneChrome49+ +
+ Opera36+Edge79+ +
+ Edge (Legacy)NoneIENone +
+ Firefox for AndroidNoneiOS SafariNoneChrome for Android49+Android WebView49+Samsung Internet4.0+Opera Mobile36+ +
+
+
partial interface ServiceWorkerRegistration {
   readonly attribute SyncManager sync;
 };
@@ -787,7 +2119,7 @@ 

sync attribute exposes a SyncManager, which has an associated service worker registration represented by the ServiceWorkerRegistration on which the attribute is exposed.

-

5.2. SyncManager interface

+

6.2. SyncManager interface

@@ -804,12 +2136,28 @@

-
[Exposed=(Window,Worker)]
+
[Exposed=(Window,Worker)]
 interface SyncManager {
-  Promise<undefined> register(DOMString tag);
-  Promise<sequence<DOMString>> getTags();
+  Promise<undefined> register(DOMString tag);
+  Promise<sequence<DOMString>> getTags();
 };
 
+
+ +
+

SyncManager/register

+

In only one current engine.

+
+ FirefoxNoneSafariNoneChrome49+ +
+ OperaNoneEdge79+ +
+ Edge (Legacy)NoneIENone +
+ Firefox for AndroidNoneiOS SafariNoneChrome for Android49+Android WebView49+Samsung Internet5.0+Opera MobileNone +
+
+

The register(tag) method, when invoked, MUST return a new promise promise and run the following steps in parallel:

  1. Let serviceWorkerRegistration be the SyncManager's associated service worker registration. @@ -842,6 +2190,22 @@

    If the user agent is currently online, fire a sync event for newRegistration.

+
+ +
+

SyncManager/getTags

+

In only one current engine.

+
+ FirefoxNoneSafariNoneChrome49+ +
+ OperaNoneEdge79+ +
+ Edge (Legacy)NoneIENone +
+ Firefox for AndroidNoneiOS SafariNoneChrome for Android49+Android WebView49+Samsung Internet5.0+Opera MobileNone +
+
+

The getTags() method when invoked, MUST return a new promise promise and run the following steps in parallel:

  1. Let serviceWorkerRegistration be the SyncManager's associated service worker registration. @@ -851,33 +2215,20 @@

-

5.3. The sync event

+

6.3. The sync event

-

SyncEvent/lastChance

+

SyncEvent

In only one current engine.

- Firefox?Safari?Chrome49+ -
- Opera?Edge79+ -
- Edge (Legacy)NoneIENone -
- Firefox for Android?iOS Safari?Chrome for Android49+Android WebViewNoneSamsung Internet5.0+Opera Mobile? -
-
-
-

SyncEvent/tag

-

In only one current engine.

-
- Firefox?Safari?Chrome49+ + FirefoxNoneSafariNoneChrome49+
Opera?Edge79+
Edge (Legacy)NoneIENone
- Firefox for Android?iOS Safari?Chrome for Android49+Android WebViewNoneSamsung Internet5.0+Opera Mobile? + Firefox for AndroidNoneiOS SafariNoneChrome for Android49+Android WebViewNoneSamsung Internet5.0+Opera Mobile?
@@ -896,21 +2247,34 @@

Firefox for Android44+iOS Safari11.3+Chrome for Android49+Android WebView49+Samsung Internet5.0+Opera Mobile24+ +
+

SyncEvent/SyncEvent

+

In only one current engine.

+
+ FirefoxNoneSafariNoneChrome49+ +
+ Opera?Edge79+ +
+ Edge (Legacy)NoneIENone +
+ Firefox for AndroidNoneiOS SafariNoneChrome for Android49+Android WebViewNoneSamsung Internet5.0+Opera Mobile? +
+
partial interface ServiceWorkerGlobalScope {
   attribute EventHandler onsync;
 };
 
-[Exposed=ServiceWorker]
+[Exposed=ServiceWorker]
 interface SyncEvent : ExtendableEvent {
   constructor(DOMString type, SyncEventInit init);
   readonly attribute DOMString tag;
-  readonly attribute boolean lastChance;
+  readonly attribute boolean lastChance;
 };
 
 dictionary SyncEventInit : ExtendableEventInit {
   required DOMString tag;
-  boolean lastChance = false;
+  boolean lastChance = false;
 };
 

Note: The SyncEvent interface represents a firing sync registration. If the page (or worker) that registered the event is running, the user agent will fire the sync event as soon as network connectivity is available. Otherwise, the user agent should run the event at the soonest convenience. If a sync event fails, the user agent may decide to retry it at a time of its choosing. The lastChance attribute is true if the user agent will not make further attempts to try this sync after the current attempt.

@@ -942,9 +2306,43 @@

Fire Functional Event "sync" using SyncEvent on serviceWorkerRegistration with the following properties:

-
tag +
+
+ +
+

SyncEvent/tag

+

In only one current engine.

+
+ FirefoxNoneSafariNoneChrome49+ +
+ Opera?Edge79+ +
+ Edge (Legacy)NoneIENone +
+ Firefox for AndroidNoneiOS SafariNoneChrome for Android49+Android WebViewNoneSamsung Internet5.0+Opera Mobile? +
+
+
+ tag
The tag associated with registration -
lastChance +
+
+ +
+

SyncEvent/lastChance

+

In only one current engine.

+
+ FirefoxNoneSafariNoneChrome49+ +
+ Opera?Edge79+ +
+ Edge (Legacy)NoneIENone +
+ Firefox for AndroidNoneiOS SafariNoneChrome for Android49+Android WebViewNoneSamsung Internet5.0+Opera Mobile? +
+
+
+ lastChance
False if the user agent will retry this sync event if it fails, or true if no further attempts will be made after the current attempt.

Then run the following steps with dispatchedEvent:

@@ -991,99 +2389,203 @@

-

Conformance

-

Document conventions

-

Conformance requirements are expressed - with a combination of descriptive assertions - and RFC 2119 terminology. - The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” - in the normative parts of this document - are to be interpreted as described in RFC 2119. - However, for readability, - these words do not appear in all uppercase letters in this specification.

-

All of the text of this specification is normative - except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

-

Examples in this specification are introduced with the words “for example” - or are set apart from the normative text - with class="example", - like this:

-
- -

This is an example of an informative example.

-
-

Informative notes begin with the word “Note” - and are set apart from the normative text - with class="note", - like this:

-

Note, this is an informative note.

-

Conformant Algorithms

-

Requirements phrased in the imperative as part of algorithms - (such as "strip any leading space characters" - or "return false and abort these steps") - are to be interpreted with the meaning of the key word - ("must", "should", "may", etc) - used in introducing the algorithm.

-

Conformance requirements phrased as algorithms or specific steps - can be implemented in any manner, - so long as the end result is equivalent. - In particular, the algorithms defined in this specification - are intended to be easy to understand - and are not intended to be performant. - Implementers are encouraged to optimize.

+

Conformance

+

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. + The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” + in the normative parts of this document + are to be interpreted as described in RFC 2119. + However, for readability, + these words do not appear in all uppercase letters in this specification.

+

All of the text of this specification is normative + except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

+

Examples in this specification are introduced with the words “for example” + or are set apart from the normative text with class="example", like this:

+
This is an example of an informative example.
+

Informative notes begin with the word “Note” + and are set apart from the normative text with class="note", like this:

+

Note, this is an informative note.

- +

Index

Terms defined by this specification

+ +

Terms defined by reference

@@ -1290,6 +2804,12 @@

browsing context
  • in parallel +
  • + [permissions] defines the following terms: +
      +
    • default powerful feature +
    • name +
  • [promises-guide] defines the following terms:
      @@ -1322,7 +2842,7 @@

      termination

  • - [WebIDL] defines the following terms: + [WEBIDL] defines the following terms: