diff --git a/apps/remix-ide-e2e/src/tests/url.test.ts b/apps/remix-ide-e2e/src/tests/url.test.ts index f2813f88ba..81fa388c38 100644 --- a/apps/remix-ide-e2e/src/tests/url.test.ts +++ b/apps/remix-ide-e2e/src/tests/url.test.ts @@ -25,5 +25,19 @@ module.exports = { .verify.elementPresent('[id="optimize"]:checked') }, + 'Should load using compiler from link passed in remix URL': function (browser: NightwatchBrowser) { + browser + .url('http://127.0.0.1:8080/#version=https://solidity-blog.s3.eu-central-1.amazonaws.com/data/08preview/soljson.js') + .refresh() + .pause(5000) + .clickLaunchIcon('solidity') + .pause(5000) + .assert.containsText('#versionSelector option[selected="selected"]', 'custom') + // default values + .verify.elementPresent('[id="optimize"]:checked') + // .assert.containsText('#evmVersionSelector option[selected="selected"]', 'compiler default') + + }, + tearDown: sauce } \ No newline at end of file diff --git a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js index 0114e653ee..6cbdcfb0c4 100644 --- a/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js +++ b/apps/remix-ide/src/app/tabs/compileTab/compilerContainer.js @@ -430,15 +430,6 @@ class CompilerContainer { this.data.selectedVersion = this.data.defaultVersion } this._view.versionSelector.innerHTML = '' - this.data.allversions.forEach(build => { - const option = build.path === this.data.selectedVersion - ? yo`` - : yo`` - - if (this._shouldBeAdded(option.innerText)) { - this._view.versionSelector.appendChild(option) - } - }) this._view.versionSelector.removeAttribute('disabled') this.queryParams.update({ version: this.data.selectedVersion }) let url @@ -460,6 +451,16 @@ class CompilerContainer { url = `${urlFromVersion(this.data.selectedVersion)}` } + this.data.allversions.forEach(build => { + const option = build.path === this.data.selectedVersion + ? yo`` + : yo`` + + if (this._shouldBeAdded(option.innerText)) { + this._view.versionSelector.appendChild(option) + } + }) + // 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.