diff options
author | Dan Finlay <dan@danfinlay.com> | 2017-05-23 06:23:29 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2017-05-23 06:23:29 +0800 |
commit | 48d9a2107130e3850077c6c1789b29a09634b168 (patch) | |
tree | b77a881766e3d620b563f8c4b1b151dbb6d796fa | |
parent | 709c0eb307e2cda9aa16b67191a43e99e1b22fa0 (diff) | |
download | tangerine-wallet-browser-48d9a2107130e3850077c6c1789b29a09634b168.tar tangerine-wallet-browser-48d9a2107130e3850077c6c1789b29a09634b168.tar.gz tangerine-wallet-browser-48d9a2107130e3850077c6c1789b29a09634b168.tar.bz2 tangerine-wallet-browser-48d9a2107130e3850077c6c1789b29a09634b168.tar.lz tangerine-wallet-browser-48d9a2107130e3850077c6c1789b29a09634b168.tar.xz tangerine-wallet-browser-48d9a2107130e3850077c6c1789b29a09634b168.tar.zst tangerine-wallet-browser-48d9a2107130e3850077c6c1789b29a09634b168.zip |
Use filter subprovider in-page to avoid filter leaks
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 8 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index 88d81cca5..9dea05dbb 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -1,6 +1,7 @@ const pipe = require('pump') -const StreamSubprovider = require('web3-stream-provider/stream-subprovider') const ProviderEngine = require('web3-provider-engine') +const FilterSubprovider = require('web3-provider-engine/subproviders/filters') +const StreamSubprovider = require('web3-stream-provider/stream-subprovider') const LocalStorageStore = require('obs-store') const ObjectMultiplex = require('./obj-multiplex') const createRandomId = require('./random-id') @@ -28,7 +29,10 @@ function MetamaskInpageProvider (connectionStream) { ) // connect to async provider - const engine = self.asyncProvider = new ProviderEngine() + const engine = new ProviderEngine() + + const filterSubprovider = new FilterSubprovider() + engine.addProvider(filterSubprovider) const stream = self.stream = new StreamSubprovider() engine.addProvider(stream) diff --git a/package.json b/package.json index 14ddd2886..5512fa6a4 100644 --- a/package.json +++ b/package.json @@ -122,7 +122,7 @@ "vreme": "^3.0.2", "web3": "0.18.2", "web3-provider-engine": "^12.0.6", - "web3-stream-provider": "^2.0.6", + "web3-stream-provider": "^3.0.0", "xtend": "^4.0.1" }, "devDependencies": { |