1 2 3 4 5
self.onmessage = (event) => { fetch(event.data) .then(response => response.text()) .then(text => self.postMessage(text)); };