extension-provider icon indicating copy to clipboard operation
extension-provider copied to clipboard

Extension closing

Open EmanuelCampos opened this issue 2 years ago • 2 comments

Hey guys,

Are you having an issue when you connect your wallet or sign metamask extension in another extension both extensions close, have a workaround/way for solve it?

EmanuelCampos avatar May 06 '22 16:05 EmanuelCampos

I don't think extensions have much or any control over whether their action views are open.

danfinlay avatar May 06 '22 17:05 danfinlay

@EmanuelCampos did you end up solving this issue? I am building up a chrome extension using react. I am doing below code in a button click event handler and expect after signing, it can go back to my popup's main page, however the Metamask closed both itself and my chrome extension popup. But when I put some breakpoint in the code, the behavior is expected. Sample code is as below shown.

const onClick = async() => {
  setLoading(true);
  const web3 = new Web3(provider); 
  const accounts = await web3.eth.requestAccounts();
  const account = accounts[0];
  await web3.eth.personal.sign(XXX, account.toLowerCase(), "");
  setLoading(false);
};
  return <LoginWall onClick={onClick}></LoginWall>

sunxivincent avatar Sep 11 '22 06:09 sunxivincent