Skip to content

Add __isMetaMaskShim__ property to injected web3#9972

Merged
rekmarks merged 1 commit intodevelopfrom
pretend-metamask-shim-web3
Dec 2, 2020
Merged

Add __isMetaMaskShim__ property to injected web3#9972
rekmarks merged 1 commit intodevelopfrom
pretend-metamask-shim-web3

Conversation

@rekmarks
Copy link
Copy Markdown
Member

@rekmarks rekmarks commented Dec 2, 2020

Adds the __isMetaMaskShim__ property to our injected window.web3 such that it will be overwritten by users of @metamask/legacy-web3.

@rekmarks rekmarks requested a review from Gudahtt December 2, 2020 20:19
@rekmarks rekmarks requested a review from a team as a code owner December 2, 2020 20:19
})

Object.defineProperty(global, 'web3', {
Object.defineProperty(window, 'web3', {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was the reason for replacing global with window? 🤔 I'm not sure what affect this has.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I just noticed we were mixing global and window. Figured I'd standardize on one. I don't think it has any effect.

Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rekmarks rekmarks merged commit 5fb2e54 into develop Dec 2, 2020
@rekmarks rekmarks deleted the pretend-metamask-shim-web3 branch December 2, 2020 20:35
@github-actions github-actions bot locked and limited conversation to collaborators Dec 2, 2020
@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [cf34e7a]
Page Load Metrics (484 ± 41 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint3090552110
domContentLoaded3266454828641
load3286464848641
domInteractive3266444828641

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants