| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/docs/Web/API/Clients/matchAll | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since April 2018.
Note: This feature is only available in Service Workers.
The matchAll() method of the Clients
interface returns a Promise for a list of service worker
Client objects. Include the options parameter to return all service worker
clients whose origin is the same as the associated service worker's origin. If options
are not included, the method returns only the service worker clients controlled by the
service worker.
matchAll()
matchAll(options)
options OptionalAn options object allowing you to set options for the matching operation. Available options are:
includeUncontrolledA boolean value if set to
true, the matching operation will return all service worker clients
who share the same origin as the current service worker. Otherwise, it returns
only the service worker clients controlled by the current service worker. The
default is false.
typeSets the type of clients you want matched. Available values
are "window", "worker", "sharedworker", and
"all". The default is "window".
A Promise that resolves to an array of Client objects. In
Chrome 46/Firefox 54 and later, this method returns clients in most recently focused
order, correct as per spec.
clients.matchAll(options).then((clientList) => {
for (const client of clientList) {
if (client.url === "index.html") {
clients.openWindow(client);
// or do something else involving the matching client
}
}
});
| Specification |
|---|
| Service Workers Nightly # clients-matchall |
This page was last modified on Jun 23, 2025 by MDN contributors.
ClientsYour blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |