separate function added

pull/1/head
Aniket-Engg 5 years ago
parent df3d49329e
commit 58a71ed806
  1. 6
      src/app/tabs/compileTab/compilerContainer.js

@ -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

Loading…
Cancel
Save