Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(MetaMaskInstaller): replace delete with assignment to undefined for window.ethereum #1162

Conversation

dominikrudzki
Copy link
Contributor

@dominikrudzki dominikrudzki commented Dec 10, 2024

Explanation

The change replaces delete window.ethereum with window.ethereum = undefined to safely clear the ethereum property without removing it from the window object. This approach ensures safer handling of the ethereum provider and avoids side effects from property deletion.

References

Fixes #1131

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

@dominikrudzki dominikrudzki requested a review from a team as a code owner December 10, 2024 20:02
@christopherferreira9 christopherferreira9 merged commit d647181 into MetaMask:main Jan 7, 2025
2 checks passed
@christopherferreira9 christopherferreira9 mentioned this pull request Jan 14, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] "Install MetaMask Extension" doesn't work with two wallets that inject window.ethereum
4 participants