aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/inpage.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/inpage.js')
-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