Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/naptha/tesseract.js.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/getEnvironment.js')
-rw-r--r--src/utils/getEnvironment.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/getEnvironment.js b/src/utils/getEnvironment.js
index 3b4f100..03f5663 100644
--- a/src/utils/getEnvironment.js
+++ b/src/utils/getEnvironment.js
@@ -3,12 +3,12 @@ const isElectron = require('is-electron');
module.exports = (key) => {
const env = {};
- if (isElectron()) {
- env.type = 'electron';
+ if (typeof WorkerGlobalScope !== 'undefined') {
+ env.type = 'webworker';
} else if (typeof window === 'object') {
env.type = 'browser';
- } else if (typeof importScripts === 'function') {
- env.type = 'webworker';
+ } else if (isElectron()) {
+ env.type = 'electron';
} else if (typeof process === 'object' && typeof require === 'function') {
env.type = 'node';
}