mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-09-10 11:54:40 +00:00
13 lines
375 B
JavaScript
13 lines
375 B
JavaScript
onconnect = function(evt) {
|
|
evt.ports[0].onmessage = function(evt) {
|
|
var bc = new BroadcastChannel('foobar');
|
|
bc.addEventListener('message', function(event) {
|
|
bc.postMessage(event.data == "hello world from the window" ?
|
|
"hello world from the worker" : "KO");
|
|
bc.close();
|
|
}, false);
|
|
|
|
evt.target.postMessage("READY");
|
|
}
|
|
}
|