Skip to content

Commit

Permalink
Data Saver Mode + permission
Browse files Browse the repository at this point in the history
Add recommendation to respect data saver mode and battery saver modes
and add a note on 'periodic-background-sync' permission.
  • Loading branch information
Mugdha Lakhani authored and mugdhalakhani committed Sep 12, 2019
1 parent d1d36bf commit 4abb1e4
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ run for a site if the user isn't currently visiting the site. It can also limit
worker is allowed to be awake for running periodic tasks.

An additional `periodic-background-sync` permission will be exposed through the Permissions API to
allow developers to query whether the API can be used.
allow developers to query whether the API can be used. The user or the user agent on behalf of the
user must set this permission to 'granted' before the website can use this capability.

# Design decisions

Expand All @@ -156,8 +157,12 @@ The interfaces mimic regular Background Sync, but substitute `navigator.sync` wi
## Power and Network conditions
The original explainer allowed the website to specify power and network conditions under which the
periodic task should be run. This proposal leaves those decisions to the browser implementation,
because we believe the browser is better positioned to make those choices for the user. This also
makes for a simpler interface for developers.
because we believe the browser is better positioned to make those choices for the user.
This also makes for a simpler interface for developers.

When the device is in either battery or data saving mode, the `periodicsync` event SHOULD not be
fired. This would also cover some situations where the browser incorrectly detects whether the
device is connected to an unmetered connection.

## Timing of periodic sync tasks
The API allows the developer to specify a `minInterval` for each periodic sync task. The browser is
Expand Down

0 comments on commit 4abb1e4

Please sign in to comment.