1 2 3 4 5
self.onmessage = e => { fetch(e.data) .then(response => response.text()) .then(text => e.source.postMessage('Worker reply:' + text)); };