OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>Shared Worker: UseCounter</title> | 2 <title>Shared Worker: UseCounter</title> |
3 <script> | 3 <script> |
4 self.connectToWorker = () => { | 4 self.connectToWorker = () => { |
5 return new Promise(resolve => { | 5 var worker = new SharedWorker('shared-worker-usecounter.js'); |
6 var worker = new SharedWorker('shared-worker-usecounter.js'); | |
7 worker.port.onmessage = resolve; | |
8 }); | |
9 }; | 6 }; |
10 window.opener.postMessage('LOADED', '*'); | 7 window.opener.postMessage('LOADED', '*'); |
11 </script> | 8 </script> |
OLD | NEW |