OLD | NEW |
1 onconnect = function(e) { | 1 onconnect = function(e) { |
2 var port = e.ports[0]; | 2 var port = e.ports[0]; |
3 var xhr = new XMLHttpRequest(); | 3 var xhr = new XMLHttpRequest(); |
4 xhr.onload = function() { port.postMessage(this.responseText); }; | 4 xhr.onload = function() { port.postMessage(this.responseText); }; |
5 xhr.onerror = function(e) { port.postMessage(e); }; | 5 xhr.onerror = function(e) { port.postMessage(e); }; |
6 xhr.open('GET', 'dummy.txt?simple', true); | 6 xhr.open('GET', 'dummy.txt?simple', true); |
7 xhr.send(); | 7 xhr.send(); |
8 }; | 8 }; |
OLD | NEW |