From bf731c78122b573c5af8161c8ee4c47e59a1dd16 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Sun, 7 Oct 2018 22:39:59 +0200 Subject: [PATCH] Add subworkers polyfill for old Chrome/Electron (fixes #37) --- app/index.js | 1 + app/worker.js | 3 +++ package.json | 1 + 3 files changed, 5 insertions(+) diff --git a/app/index.js b/app/index.js index 278516b..fe786d1 100644 --- a/app/index.js +++ b/app/index.js @@ -1,4 +1,5 @@ import 'stream-browserify' // see https://github.com/ericgundrum/pouch-websocket-sync-example/commit/2a4437b013092cc7b2cd84cf1499172c84a963a3 +import 'subworkers' // polyfill for https://bugs.chromium.org/p/chromium/issues/detail?id=31666 import url from 'url' import ByteBuffer from 'bytebuffer' import MumbleClient from 'mumble-client' diff --git a/app/worker.js b/app/worker.js index 31f8e0f..0a5869e 100644 --- a/app/worker.js +++ b/app/worker.js @@ -4,6 +4,9 @@ import toArrayBuffer from 'to-arraybuffer' import chunker from 'stream-chunker' import Resampler from 'libsamplerate.js' +// Polyfill nested webworkers for https://bugs.chromium.org/p/chromium/issues/detail?id=31666 +import 'subworkers' + // Monkey-patch to allow webworkify-webpack and codecs to work inside of web worker /* global URL */ window.URL = URL diff --git a/package.json b/package.json index 4e721a0..962a039 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "regexp-replace-loader": "0.0.1", "sass-loader": "^4.1.1", "stream-chunker": "^1.2.8", + "subworkers": "^1.0.1", "to-arraybuffer": "^1.0.1", "transform-loader": "^0.2.3", "voice-activity-detection": "johni0702/voice-activity-detection#9f8bd90",