diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-08-05 04:26:03 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-08-05 04:26:03 +0800 |
commit | 479abadaa7dc59dc900cb35e897e0f164e3bb345 (patch) | |
tree | 07ea368e21d9c8277828e76e975f4671270b10a4 /app/scripts/lib | |
parent | 0ae5305822b86e43c7921c53456a4042b4bc8af6 (diff) | |
parent | 106cbc133f26606449746587d4a33a3b8fb3f727 (diff) | |
download | tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.gz tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.bz2 tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.lz tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.xz tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.tar.zst tangerine-wallet-browser-479abadaa7dc59dc900cb35e897e0f164e3bb345.zip |
Merge branch 'master' into usd-conversion
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/config-manager.js | 4 | ||||
-rw-r--r-- | app/scripts/lib/extension-instance.js | 25 |
2 files changed, 23 insertions, 6 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 8d250e555..9c37a2c6f 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -5,6 +5,7 @@ const rp = require('request-promise') const TESTNET_RPC = MetamaskConfig.network.testnet const MAINNET_RPC = MetamaskConfig.network.mainnet +const CLASSIC_RPC = MetamaskConfig.network.classic /* The config-manager is a convenience object * wrapping a pojo-migrator. @@ -145,6 +146,9 @@ ConfigManager.prototype.getCurrentRpcAddress = function () { case 'testnet': return TESTNET_RPC + case 'classic': + return CLASSIC_RPC + default: return provider && provider.rpcTarget ? provider.rpcTarget : TESTNET_RPC } diff --git a/app/scripts/lib/extension-instance.js b/app/scripts/lib/extension-instance.js index eeab6c6d0..eb3b8a1e9 100644 --- a/app/scripts/lib/extension-instance.js +++ b/app/scripts/lib/extension-instance.js @@ -24,14 +24,27 @@ const apis = [ function Extension () { const _this = this - let global = window - - if (window.chrome) { - global = window.chrome - } apis.forEach(function (api) { - _this[api] = global[api] + + _this[api] = null + + try { + if (chrome[api]) { + _this[api] = chrome[api] + } + } catch (e) {} + + try { + if (window[api]) { + _this[api] = window[api] + } + } catch (e) {} + + try { + _this.api = browser.extension[api] + } catch (e) {} + }) } |