|
|
|
@ -320,7 +320,7 @@ class CompilerContainer { |
|
|
|
|
url = `${this.data.baseurl}/${this.data.selectedVersion}` |
|
|
|
|
} |
|
|
|
|
// Check if browser is compatible with web worker
|
|
|
|
|
if (document.location.protocol !== 'file:' && Worker !== undefined) { |
|
|
|
|
if (this.browserSupportWorker) { |
|
|
|
|
// Workers cannot load js on "file:"-URLs and we get a
|
|
|
|
|
// "Uncaught RangeError: Maximum call stack size exceeded" error on Chromium,
|
|
|
|
|
// resort to non-worker version in that case.
|
|
|
|
@ -374,6 +374,10 @@ class CompilerContainer { |
|
|
|
|
this.data.compileTimeout = window.setTimeout(() => this.compileIfAutoCompileOn(), this.data.timeout) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
browserSupportWorker () { |
|
|
|
|
return document.location.protocol !== 'file:' && Worker !== undefined |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
module.exports = CompilerContainer |
|
|
|
|