Debian Codegraph @

testing/web-platform/mozilla/tests/push-api/push-sw.js

raw
1 async function postAll(data) {
2 const clients = await self.clients.matchAll({ includeUncontrolled: true });
3 for (const client of clients) {
4 client.postMessage(data);
5 }
6 }
7
8 onpushsubscriptionchange = ev => {
9 postAll({
10 type: ev.type,
11 constructor: ev.constructor.name,
12 oldSubscription: ev.oldSubscription?.toJSON(),
13 newSubscription: ev.newSubscription?.toJSON(),
14 });
15 }