Merge branch 'dev' of github.com:MetaMask/metamask-plugin into dev

feature/default_network_editable
Dan Finlay 9 years ago
commit a439e04ed4
  1. 8
      app/scripts/contentscript.js
  2. 4
      app/scripts/inpage.js

@ -25,14 +25,14 @@ pluginStream.on('error', console.error.bind(console))
// forward communication plugin->inpage // forward communication plugin->inpage
pageStream.pipe(pluginStream).pipe(pageStream) pageStream.pipe(pluginStream).pipe(pageStream)
// connect contentscript->inpage control stream // connect contentscript->inpage reload stream
var mx = ObjectMultiplex() var mx = ObjectMultiplex()
mx.on('error', console.error.bind(console)) mx.on('error', console.error.bind(console))
mx.pipe(pageStream) mx.pipe(pageStream)
var controlStream = mx.createStream('control') var reloadStream = mx.createStream('reload')
controlStream.on('error', console.error.bind(console)) reloadStream.on('error', console.error.bind(console))
// if we lose connection with the plugin, trigger tab refresh // if we lose connection with the plugin, trigger tab refresh
pluginStream.on('close', function(){ pluginStream.on('close', function(){
controlStream.write({ method: 'reset' }) reloadStream.write({ method: 'reset' })
}) })

@ -36,8 +36,8 @@ console.log('MetaMask - injected web3')
// export global web3 with auto dapp reload // export global web3 with auto dapp reload
// //
var controlStream = inpageProvider.multiStream.createStream('control') var reloadStream = inpageProvider.multiStream.createStream('reload')
setupDappAutoReload(web3, controlStream) setupDappAutoReload(web3, reloadStream)
// set web3 defaultAcount // set web3 defaultAcount
inpageProvider.publicConfigStore.subscribe(function(state){ inpageProvider.publicConfigStore.subscribe(function(state){

Loading…
Cancel
Save