web api instance method
PeriodicSyncManager: getTags() method
Limited availabilityAvailable in workers
The getTags() method of the
PeriodicSyncManager interface returns a Promise that
resolves with a list of String objects representing the tags that are
currently registered for periodic syncing.
Syntax
getTags()
Parameters
None.
Return value
A Promise which resolves with a list of String objects
representing tags that are currently registered for periodic syncing.
Exceptions
None.
Examples
The following example uses the getTags() method to check if a periodic
sync task with a given tag is registered.
navigator.serviceWorker.ready.then((registration) => {
registration.periodicSync.getTags().then((tags) => {
if (tags.includes("get-latest-news")) skipDownloadingLatestNewsOnPageLoad();
});
});
skipDownloadingLatestNewsOnPageLoad() is a developer defined function.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.