-
Notifications
You must be signed in to change notification settings - Fork 22.5k
/
index.md
59 lines (40 loc) · 1.37 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
---
title: "PeriodicSyncManager: unregister() method"
short-title: unregister()
slug: Web/API/PeriodicSyncManager/unregister
page-type: web-api-instance-method
status:
- experimental
browser-compat: api.PeriodicSyncManager.unregister
---
{{APIRef("Periodic Background Sync")}}{{SeeCompatTable}}{{AvailableInWorkers}}
The **`unregister()`** method of the
{{domxref("PeriodicSyncManager")}} interface unregisters the periodic sync request
corresponding to the specified tag and returns a {{jsxref('Promise')}} that resolves
when unregistration completes.
## Syntax
```js-nolint
unregister(tag)
```
### Parameters
- tag
- : The unique {{jsxref('String')}} descriptor for the specific background sync.
### Return value
Returns a {{jsxref("Promise")}} that resolves with {{jsxref('undefined')}}.
### Exceptions
None.
## Examples
The following example removes a periodic sync to stop syncing articles in the
background.
```js
navigator.serviceWorker.ready.then((registration) => {
registration.periodicSync.unregister("get-latest-news");
});
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- [Richer offline experiences with the Periodic Background Sync API](https://developer.chrome.com/docs/capabilities/periodic-background-sync)
- [A Periodic Background Sync demo app](https://webplatformapis.com/periodic_sync/periodicSync_improved.html)