servo/tests/wpt/web-platform-tests/eventsource/shared-worker/eventsource-url.js

10 lines
No EOL
225 B
JavaScript

onconnect = function(e) {
try {
var port = e.ports[0]
var source = new EventSource("../resources/message.py")
port.postMessage([true, source.url])
source.close()
} catch(e) {
port.postMessage([false, String(e)])
}
}