1self.addEventListener('message', e => { 2 URL.revokeObjectURL(e.data.url); 3 // Registering a new object URL will make absolutely sure that the revocation 4 // has propagated. Without this at least in chrome it is possible for the 5 // below postMessage to arrive at its destination before the revocation has 6 // been fully processed. 7 URL.createObjectURL(new Blob([])); 8 self.postMessage('revoked'); 9}); 10