blob: a68dc5b0b7dac67037315d293ae879cc70fc2a4d [file] [log] [blame]
onconnect = function(e) {
try {
var port = e.ports[0]
var url = decodeURIComponent(location.hash.substr(1))
var source = new EventSource(url)
source.onerror = function(e) {
port.postMessage([true, this.readyState, 'data' in e])
this.close();
}
} catch(e) {
port.postMessage([false, String(e)])
}
}