Update spawnWorker.js

This commit is contained in:
jeromewu 2020-03-12 17:17:39 +08:00 committed by GitHub
parent c81a451280
commit 209737ed1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,7 +10,7 @@ module.exports = ({ workerPath, workerBlobURL }) => {
if (Blob && URL && workerBlobURL) { if (Blob && URL && workerBlobURL) {
/* Use Blob to load cross domain worker script */ /* Use Blob to load cross domain worker script */
const blob = new Blob([`importScripts("${workerPath}");`], { const blob = new Blob([`importScripts("${workerPath}");`], {
type: 'application/javascript', type: 'text/javascript',
}); });
worker = new Worker(URL.createObjectURL(blob)); worker = new Worker(URL.createObjectURL(blob));
} else { } else {