12 lines
No EOL
268 B
JavaScript
12 lines
No EOL
268 B
JavaScript
onconnect = function(e) {
|
|
try {
|
|
var port = e.ports[0]
|
|
var source = new EventSource("../resources/message.py")
|
|
source.onopen = function(e) {
|
|
this.close()
|
|
port.postMessage([true, this.readyState])
|
|
}
|
|
} catch(e) {
|
|
port.postMessage([false, String(e)])
|
|
}
|
|
} |