shunkakinoki / Wallet

🪄 - Open source EVM Wallet
https://wallet.light.so
GNU General Public License v3.0
121 stars 14 forks source link

Detect if origin is a dapp #1

Open DimitarNestorov opened 1 year ago

DimitarNestorov commented 1 year ago

Problem

Currently the extension replaces every instance of MetaMask to Light Wallet. This can cause confusion.

Example URLs

Screenshots

Google Search https://metamask.io

Possible solution

Make window.ethereum a proxy object and as soon as a property is accessed enable the find and replace functionality. Also add in local storage a key that this origin is a dapp so that the UX is less janky on the next refresh.

DimitarNestorov commented 1 year ago

For the beta a simple whitelist of famous dapps should suffice.