diff options
Merge branch 'master' of github.com:MetaMask/metamask-extension into filter-leak-fix
Diffstat (limited to 'app')
-rw-r--r-- | app/manifest.json | 7 | ||||
-rw-r--r-- | app/scripts/lib/inpage-provider.js | 20 |
2 files changed, 15 insertions, 12 deletions
diff --git a/app/manifest.json b/app/manifest.json index 256737c89..f597bec7f 100644 --- a/app/manifest.json +++ b/app/manifest.json @@ -1,7 +1,7 @@ { "name": "MetaMask", "short_name": "Metamask", - "version": "3.9.12", + "version": "3.9.13", "manifest_version": 2, "author": "https://metamask.io", "description": "Ethereum Browser Extension", @@ -57,9 +57,8 @@ "permissions": [ "storage", "clipboardWrite", - "http://localhost:8545/", - "https://api.cryptonator.com/" - ], + "http://localhost:8545/" + ], "web_accessible_resources": [ "scripts/inpage.js" ], diff --git a/app/scripts/lib/inpage-provider.js b/app/scripts/lib/inpage-provider.js index b2515bfb8..da75c4be2 100644 --- a/app/scripts/lib/inpage-provider.js +++ b/app/scripts/lib/inpage-provider.js @@ -38,14 +38,22 @@ function MetamaskInpageProvider (connectionStream) { streamMiddleware.stream, (err) => logStreamDisconnectWarning('MetaMask RpcProvider', err) ) + // handle sendAsync requests via dapp-side rpc engine - const engine = new RpcEngine() - engine.push(createIdRemapMiddleware()) - engine.push(streamMiddleware) + const rpcEngine = new RpcEngine() + rpcEngine.push(createIdRemapMiddleware()) + rpcEngine.push(streamMiddleware) + self.rpcEngine = rpcEngine +} - self.sendAsync = engine.handle.bind(engine) +// handle sendAsync requests via asyncProvider +// also remap ids inbound and outbound +MetamaskInpageProvider.prototype.sendAsync = function (payload, cb) { + const self = this + self.rpcEngine.handle(payload, cb) } + MetamaskInpageProvider.prototype.send = function (payload) { const self = this @@ -91,10 +99,6 @@ MetamaskInpageProvider.prototype.send = function (payload) { } } -MetamaskInpageProvider.prototype.sendAsync = function () { - throw new Error('MetamaskInpageProvider - sendAsync not overwritten') -} - MetamaskInpageProvider.prototype.isConnected = function () { return true } |