From 8fdda048f67e337bc9fdd9ff70ebd1c738caa6a6 Mon Sep 17 00:00:00 2001 From: Emmm Monster <58943012+emmmx@users.noreply.github.com> Date: Thu, 1 Jul 2021 01:29:04 +0800 Subject: [PATCH] fix: avoid using worker in file protocol --- src/component/FileSelector.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/FileSelector.vue b/src/component/FileSelector.vue index 623b52f..126a417 100644 --- a/src/component/FileSelector.vue +++ b/src/component/FileSelector.vue @@ -63,7 +63,7 @@ export default { } }, mounted() { - if (window.Worker && process.env.NODE_ENV === 'production') { + if (window.Worker && window.location.protocol !== "file:" && process.env.NODE_ENV === 'production') { console.log("Using Worker Pool") this.queue = Pool( () => spawn(new Worker('@/utils/worker.ts')),