mirror of
https://github.com/servo/servo.git
synced 2025-10-16 08:20:22 +01:00
12 lines
No EOL
262 B
JavaScript
12 lines
No EOL
262 B
JavaScript
onconnect = function(e) {
|
|
try {
|
|
var port = e.ports[0]
|
|
var source = new EventSource("../resources/message.py")
|
|
source.onmessage = function(e) {
|
|
port.postMessage([true, e.data])
|
|
this.close()
|
|
}
|
|
} catch(e) {
|
|
port.postMessage([false, String(e)])
|
|
}
|
|
} |