Skip to content

Commit

Permalink
Omit MetaMask extensionId from site metadata
Browse files Browse the repository at this point in the history
The site metadata was updated in #7218 to include the extension id of
the extension connecting to MetaMask. This was done to allow external
extensions to connect with MetaMask, so that we could show the id on
the provider approval screen.

Unbeknownst to me at the time, the extension id was being set for all
connections to MetaMask from dapps. The id was set to MetaMask's id,
because the connections are made through MetaMask's contentscript.

This has been updated to only set the id when accepting a connection
from a different extension.
  • Loading branch information
Gudahtt committed Nov 4, 2019
1 parent dbd14d7 commit a74bc3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ function setupController (initState, initLangCode) {
// communication with page or other extension
function connectExternal (remotePort) {
const senderUrl = new URL(remotePort.sender.url)
const extensionId = remotePort.sender.id
let extensionId
if (remotePort.sender.id !== extension.runtime.id) {
extensionId = remotePort.sender.id
}
const portStream = new PortStream(remotePort)
controller.setupUntrustedCommunication(portStream, senderUrl, extensionId)
}
Expand Down

0 comments on commit a74bc3a

Please sign in to comment.