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

Cannot connect to Etherscan if MetaMask is enabled #484

Open
jfschwarz opened this issue Jan 8, 2025 · 6 comments
Open

Cannot connect to Etherscan if MetaMask is enabled #484

jfschwarz opened this issue Jan 8, 2025 · 6 comments
Assignees

Comments

@jfschwarz
Copy link
Collaborator

Describe the bug
Up until very recently you could connect Etherscan to Pilot to capture calls encoded there. This no longer seems possible

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://etherscan.io/address/0x27d8bb2e33Bc38A9CE93fdD90C80677b8436aFfb#writeContract
  2. Open Pilot panel
  3. Click on Connect to Web3 button in Etherscan
  4. Select MetaMask in the modal

It's now connected to MetaMask.

Expected behavior
It should be connected to Pilot. This used to work (even though the button always said MetaMask).

@jfschwarz jfschwarz added the bug label Jan 8, 2025
@jfschwarz
Copy link
Collaborator Author

same problem on https://abi.ninja

@frontendphil
Copy link
Member

It works when I use Rabby. But, as you said, it won't when I have the MetaMask extension running. Maybe this also has something to do with our current issues connecting MetaMask... I'll put some more work into externalizing the route configuration and will then get back to this.

@frontendphil
Copy link
Member

I've looked at the Etherscan code, and when you click "MetaMask," they select the provider by name. Since we are nice enough to register as "Zodiac" and not "MetaMask," this throws us out and uses the meta mask provider that announced itself with the respective name.

I'll need some more time to look into ways how to solve this.

@jfschwarz
Copy link
Collaborator Author

I've looked at the Etherscan code, and when you click "MetaMask," they select the provider by name. Since we are nice enough to register as "Zodiac" and not "MetaMask," this throws us out and uses the meta mask provider that announced itself with the respective name.

I'll need some more time to look into ways how to solve this.

We could simply maintain a list of hostnames where we impersonate metamask, also by setting the provider name.

@jfschwarz jfschwarz reopened this Feb 11, 2025
@jfschwarz
Copy link
Collaborator Author

jfschwarz commented Feb 11, 2025

Seems this is not yet fixed and should not haven been marked as completed

@jfschwarz jfschwarz changed the title Cannot connect to Etherscan anymore Cannot connect to Etherscan if MetaMask is enabled Feb 11, 2025
@frontendphil frontendphil self-assigned this Feb 13, 2025
frontendphil added a commit that referenced this issue Feb 13, 2025
Part of #484 

This PR partially resolves the issue. At least it is now possible to
connect to etherscan.io **at all**. What is still not working properly
is connecting to etherscan when the MetaMask extension is **also**
enabled. This fix **only** works if the extension is disabled.
@frontendphil
Copy link
Member

@jfschwarz, it seems like you've clicked the wrong button ;)

I've added the list you were talking about, which partially solves this issue. We're now able to connect at all. However, as soon as the meta mask extension is active in the browser, it will always take precedence over ours. This might be a general issue but I'll need to further look into this to be sure.

If it's a more general issue, I'll open up another bug and close this one. Otherwise, I'll keep working in this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants