Unverified Commit 1ec92b2d authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #1495 from ethereum/addProviderEndPoint

Add getProviderEndpoint API
parents c9863057 4500f935
...@@ -11,6 +11,13 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) => ...@@ -11,6 +11,13 @@ module.exports = (pluginManager, fileProviders, fileManager, compiler, udapp) =>
getExecutionContextProvider: (mod, cb) => { getExecutionContextProvider: (mod, cb) => {
cb(null, executionContext.getProvider()) cb(null, executionContext.getProvider())
}, },
getProviderEndpoint: (mod, cb) => {
if (executionContext.getProvider() === 'web3') {
cb(null, executionContext.web3().currentProvider.host)
} else {
cb('no endpoint: current provider is either injected or vm')
}
},
updateTitle: (mod, title, cb) => { updateTitle: (mod, title, cb) => {
pluginManager.plugins[mod].modal.setTitle(title) pluginManager.plugins[mod].modal.setTitle(title)
if (cb) cb() if (cb) cb()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment