summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/service-workers/service-worker/resources/postmessage-to-client-worker.js
blob: 290a4a9b3e9d9263645b4154eae151e2b06b3eae (plain)
1
2
3
4
5
6
7
8
9
10
self.onmessage = function(e) {
  self.clients.matchAll().then(function(clients) {
      clients.forEach(function(client) {
          client.postMessage('Sending message via clients');
          if (!Array.isArray(clients))
            client.postMessage('clients is not an array');
          client.postMessage('quit');
        });
    });
};