diff --git a/src/app.js b/src/app.js index ddc0a30cf2..b398d7db8a 100644 --- a/src/app.js +++ b/src/app.js @@ -109,6 +109,7 @@ class App { self._api = {} var fileStorage = new Storage('sol:') self._api.config = new Config(fileStorage) + executionContext.init(self._api.config) self._api.filesProviders = {} self._api.filesProviders['browser'] = new Browserfiles(fileStorage) self._api.filesProviders['localhost'] = new SharedFolder(new Remixd()) diff --git a/src/execution-context.js b/src/execution-context.js index c157eea1fc..72a822a734 100644 --- a/src/execution-context.js +++ b/src/execution-context.js @@ -82,7 +82,16 @@ var mainNetGenesisHash = '0xd4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec function ExecutionContext () { var self = this this.event = new EventManager() - var executionContext = 'vm' + + var executionContext = null + + this.init = function (config) { + if (config.get('settings/always-use-vm')) { + executionContext = 'vm' + } else { + executionContext = injectedProvider ? 'injected' : 'vm' + } + } this.getProvider = function () { return executionContext