Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/web/api/backgroundfetchmanager/getids/index.md
6517 views
---
title: BackgroundFetchManager.getIds() slug: Web/API/BackgroundFetchManager/getIds page-type: web-api-instance-method status: - experimental browser-compat: api.BackgroundFetchManager.getIds
---

{{APIRef("Background Fetch API")}}{{SeeCompatTable}}

The getIds() method of the {{domxref("BackgroundFetchManager")}} interface returns the IDs of all registered background fetches.

Syntax

getIds()

Parameters

None.

Return value

A {{jsxref("Promise")}} that resolves with an {{jsxref('Array')}} of {{jsxref('String', 'strings')}}.

Exceptions

None.

Examples

The following examples shows how to retrieve the IDs of all registered background fetches. With an active service worker, use the {{domxref('ServiceWorkerRegistration.backgroundFetch')}} property to access the BackgroundFetchManager object and call its getIds() method.

navigator.serviceWorker.ready.then(async (swReg) => { const ids = await swReg.backgroundFetch.getIds(); });

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}