gecko-dev/dom/broadcastchannel/tests/broadcastchannel_worker_ali...

9 строки
224 B
JavaScript

(new BroadcastChannel('foobar')).postMessage('READY');
(new BroadcastChannel('foobar')).addEventListener('message', function(event) {
if (event.data != 'READY') {
event.target.postMessage(event.data);
}
}, false);