summaryrefslogtreecommitdiffstats
path: root/dom/serviceworkers/test/message_posting_worker.js
blob: 5fcd0a741e705d8ae3a103b9bff3b563f802e56a (plain)
1
2
3
4
5
6
7
8
onmessage = function (e) {
  self.clients.matchAll().then(function (res) {
    if (!res.length) {
      dump("ERROR: no clients are currently controlled.\n");
    }
    res[0].postMessage(e.data);
  });
};