| <!DOCTYPE html> | |
| <meta charset="utf-8"> | |
| <!-- Disable favicon fetching. --> | |
| <link rel="icon" href="data:;base64,="> | |
| <title>create a shared worker</title> | |
| <script> | |
| const params = new URLSearchParams(location.search); | |
| const worker = new SharedWorker(params.get('worker_url')); | |
| const onmessage_promise = new Promise(r => worker.port.onmessage = r); | |
| async function waitForMessage() { | |
| const message = await onmessage_promise; | |
| return message.data; | |
| } | |
| </script> |