worker.js (290B)
1 self.onmessage = function(message) { 2 const length = message.data.bytes; 3 self.root = new Uint8Array(length); 4 // Set some elements to disable potential copy-on-write optimizations. 5 for (let i = 0; i < length; i += 256) { 6 self.root[i] = 1; 7 } 8 postMessage(self.location.href); 9 }