blob: 5a90c0fba8d22c6f8aa515138c4638d57804ad5e [file]
<!DOCTYPE html>
<meta charset="utf-8">
<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>