electron/spec/fixtures/workers/load_shared_worker.html

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
344 B
HTML
Raw Normal View History

<script>
function loadSharedWorker(url) {
return new Promise((resolve) => {
try {
const w = new SharedWorker(url);
w.onerror = () => resolve('failed');
w.port.onmessage = (m) => resolve(m.data);
w.port.postMessage('success');
} catch {
resolve('failed');
}
});
}
</script>