Merge pull request #2352 from ethereum/webworker

firefox restriction removed
pull/3094/head
Liana Husikyan 6 years ago committed by GitHub
commit 0ee39789a7
  1. 8
      src/app/tabs/compileTab/compilerContainer.js
  2. 5
      test-browser/commands/verifyContracts.js

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

@ -13,7 +13,10 @@ class VerifyContracts extends EventEmitter {
} }
function getCompiledContracts (browser, callback) { function getCompiledContracts (browser, callback) {
browser.clickLaunchIcon('solidity').execute(function () { browser
.clickLaunchIcon('solidity')
.waitForElementPresent('#compileTabView select#compiledContracts option')
.execute(function () {
var contracts = document.querySelectorAll('#compileTabView select#compiledContracts option') var contracts = document.querySelectorAll('#compileTabView select#compiledContracts option')
if (!contracts) { if (!contracts) {
return null return null

Loading…
Cancel
Save