ChainSafe / dappeteer

[DEPRECATED]🏌🏼‍E2E testing for dApps using Puppeteer + MetaMask
Other
492 stars 154 forks source link

How to connect to an existing browser with MetaMask already installed? #331

Open yt7260 opened 1 year ago

yt7260 commented 1 year ago

Describe the problem A clear and concise description of what the problem is.

OS: win 10 NodeJs version v18.13.0 dappeteer version 5.1.1 puppeteer version 19.8.1

I have already connected to an existing browser that has Metamask installed, but I am unable to operate it.

const browser = await puppeteer.connect({ browserWSEndpoint: res.data.data.ws.puppeteer, defaultViewport: null, headless: false }); const userData = "E:/.cache/j5y43xo_hdspfh/Default/Extensions/"; const browserInstance = new DPuppeteerBrowser(browser, userData, false); const metamask = await dappeteer.getMetaMaskWindow(browserInstance); await metamask.unlock('111111');

The error message: throw new Error("You can't sign in because you are already signed in");

openluminus commented 1 year ago

This issue looks a lot like #299