gecko-dev/dom/serviceworkers/test/message_posting_worker.js

9 строки
204 B
JavaScript

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);
});
};