summaryrefslogtreecommitdiffstats
path: root/dom/workers/test/serviceworkers/message_posting_worker.js
blob: 26db997759f7e914e32ff2739c06bf0445c14480 (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);
  });
};