blob: ddc8bea7af476e1ace023a693c31c463b7a077e5 (
plain)
1
2
3
4
5
6
7
8
|
self.onconnect = (event) => {
var port = event.ports[0];
event.ports[0].onmessage = (evt) => {
fetch(evt.data)
.then(response => response.text())
.then(text => port.postMessage(text));
};
};
|