diff --git a/src/app/tabs/runTab/settings.js b/src/app/tabs/runTab/settings.js index b667614fb0..61f657fbe1 100644 --- a/src/app/tabs/runTab/settings.js +++ b/src/app/tabs/runTab/settings.js @@ -178,14 +178,11 @@ class SettingsUI { selectExEnv.addEventListener('change', (event) => { let context = selectExEnv.options[selectExEnv.selectedIndex].value this.settings.changeExecutionContext(context, () => { - const modal = modalDialogCustom.confirm('External node request', 'Are you sure you want to connect to an ethereum node?', () => { - modal.hide() - modalDialogCustom.prompt('External node request', 'Web3 Provider Endpoint', 'http://localhost:8545', (target) => { - this.settings.setProviderFromEndpoint(target, context, (alertMsg) => { - if (alertMsg) addTooltip(alertMsg) - this.setFinalContext() - }) - }, this.setFinalContext.bind(this)) + modalDialogCustom.prompt('External node request', this.web3ProviderDialogBody(), 'http://localhost:8545', (target) => { + this.settings.setProviderFromEndpoint(target, context, (alertMsg) => { + if (alertMsg) addTooltip(alertMsg) + this.setFinalContext() + }) }, this.setFinalContext.bind(this)) }, (alertMsg) => { addTooltip(alertMsg) @@ -195,6 +192,20 @@ class SettingsUI { selectExEnv.value = this.settings.getProvider() } + web3ProviderDialogBody () { + return yo` +
+ Note: If you are using + Geth + , please configure it to allow requests from Remix: +
+ geth --rpc --rpccorsdomain https://remix.ethereum.org +

+ Web3 Provider Endpoint +
+ ` + } + setFinalContext () { // set the final context. Cause it is possible that this is not the one we've originaly selected this.selectExEnv.value = this.settings.getProvider()