From 95cc9cecf0b7f8eecbda844cc96d8dae51d3da4f Mon Sep 17 00:00:00 2001 From: Daniel Huigens Date: Fri, 21 Dec 2018 23:08:15 -0500 Subject: [PATCH] Disable Web Workers on browsers without MessageChannel support For compatibility with old Firefox / Pale Moon 27 --- src/openpgp.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openpgp.js b/src/openpgp.js index abf03ab6..96c2f55d 100644 --- a/src/openpgp.js +++ b/src/openpgp.js @@ -65,7 +65,7 @@ let asyncProxy; // instance of the asyncproxy * @param {Array} workers alternative to path parameter: web workers initialized with 'openpgp.worker.js' */ export function initWorker({ path='openpgp.worker.js', n = 1, workers = [] } = {}) { - if (workers.length || (typeof window !== 'undefined' && window.Worker)) { + if (workers.length || (typeof window !== 'undefined' && window.Worker && window.MessageChannel)) { asyncProxy = new AsyncProxy({ path, n, workers, config }); return true; }