aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2016-01-31 15:15:38 +0800
committerkumavis <aaron@kumavis.me>2016-01-31 15:15:38 +0800
commitc2eb3f6524ec783fd842142d3de57e115a184ead (patch)
treeb615a65a761b6e23135dc3e6b2fdb656a9d56d75
parent2aa38ac4b44c21bd3a26de90fa23beb8ffbb6f27 (diff)
downloadtangerine-wallet-browser-c2eb3f6524ec783fd842142d3de57e115a184ead.tar
tangerine-wallet-browser-c2eb3f6524ec783fd842142d3de57e115a184ead.tar.gz
tangerine-wallet-browser-c2eb3f6524ec783fd842142d3de57e115a184ead.tar.bz2
tangerine-wallet-browser-c2eb3f6524ec783fd842142d3de57e115a184ead.tar.lz
tangerine-wallet-browser-c2eb3f6524ec783fd842142d3de57e115a184ead.tar.xz
tangerine-wallet-browser-c2eb3f6524ec783fd842142d3de57e115a184ead.tar.zst
tangerine-wallet-browser-c2eb3f6524ec783fd842142d3de57e115a184ead.zip
add basic sync support
-rw-r--r--app/scripts/inpage.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/app/scripts/inpage.js b/app/scripts/inpage.js
index d45dde593..2d872e08e 100644
--- a/app/scripts/inpage.js
+++ b/app/scripts/inpage.js
@@ -11,8 +11,14 @@ var pluginStream = new LocalMessageDuplexStream({
var remoteProvider = new StreamProvider()
remoteProvider.pipe(pluginStream).pipe(remoteProvider)
+// handle synchronous methods remotely
+var syncProvider = new Web3.providers.HttpProvider('https://rawtestrpc.metamask.io/')
+remoteProvider.send = syncProvider.send.bind(syncProvider)
+
// create web3
var web3 = new Web3(remoteProvider)
window.web3 = web3
-web3.setProvider = function(){}
-console.log('Metamask injected web3') \ No newline at end of file
+web3.setProvider = function(){
+ console.log('MetaMask Extension - overrode web3.setProvider')
+}
+console.log('MetaMask Extension - injected web3') \ No newline at end of file