W3cubDocs

/Web APIs

PeriodicSyncManager: getTags() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Note: This feature is available in Web 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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
getTags 80 80 No 67 No 80 No 57 No 13.0 No No

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/PeriodicSyncManager/getTags