metamask login – Launch MetaMask Login Window with JavaScript

metamaskweb3js

I have installed MetaMask extension for Chrome, then I saw ext icon at top toolbar. To login I will open it by click on the icon. There is a question…

Is there a way to launch MetaMask window by JavaScript?
I want use my own Login button at web page to launch login screen.

MetaMask login

Best Answer

Chrome extension popups like this can only be opened by the user triggering it themselves, either by clicking on the icon or a keyboard shortcut.

You could use the ethereum.enable() call they've recently added to prompt the user though: https://medium.com/metamask/https-medium-com-metamask-breaking-change-injecting-web3-7722797916a8. This may provide the type of user experience you'd expect.

Related Topic