mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +03:00
190ed9465f
This prevents shared workers from stalling upon restart. We receive `Inspector.targetCrashed` and `Inspector.targetReloadedAfterCrash` events that assume `Runtime.runIfWaitingForDebugger` from any attached client. It is easier and more stable to just detach from shared workers, because we do not inspect them. For service workers, we should actually issue `Runtime.runIfWaitingForDebugger` in such cases, because we attach to them. Fixes #18932.
7 lines
242 B
HTML
7 lines
242 B
HTML
<script>
|
|
window.sharedWorkerResponsePromise = new Promise(f => {
|
|
window.myWorker = new SharedWorker("shared-worker.js");
|
|
window.myWorker.port.postMessage('hello');
|
|
window.myWorker.port.onmessage = e => f(e.data);
|
|
});
|
|
</script> |