files/en-us/web/api/backgroundfetchregistration/matchall/index.md
{{APIRef("Background Fetch API")}}{{SeeCompatTable}}{{AvailableInWorkers}}
The matchAll() method of the {{domxref("BackgroundFetchRegistration")}} interface returns an array of matching {{domxref("BackgroundFetchRecord")}} objects.
matchAll()
matchAll(request)
matchAll(request,options)
request {{optional_inline}}
options {{optional_inline}}
match operation. The available
options are:
ignoreSearch {{optional_inline}}
true the ?value=bar part of
https://example.com/?value=bar would be ignored when performing a match.
It defaults to false.ignoreMethod {{optional_inline}}
true,
prevents matching operations from validating the {{domxref("Request")}} http method.
If false (the default) only GET and HEAD are allowed.ignoreVary {{optional_inline}}
true indicates that the {{HTTPHeader("Vary")}} header should be ignored.
It defaults to false.A {{jsxref("Promise")}} that resolves with an array of all matching {{domxref("BackgroundFetchRecord")}} objects.
InvalidStateError {{domxref("DOMException")}}
false, indicating that there is no fetch in progress.Use matchAll() with no parameters to return all of the records in a background fetch.
const records = await bgFetch.matchAll();
console.log(records); // an array of BackgroundFetchRecord objects
{{Specifications}}
{{Compat}}