blob: 761165118ac788fb7df2ae0c62e1d43d32041852 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
onconnect = function(e) {
try {
var port = e.ports[0]
var source = new EventSource("../resources/message.py")
source.addEventListener("message", listener, false)
function listener(e) {
port.postMessage([true, e.data])
this.close()
}
} catch(e) {
port.postMessage([false, String(e)])
}
}
|