Open Velkonost opened 1 year ago
Hey, thanks for reaching out.
The issue is you are sending a Browser
instance not a DappeteerBrowser
.
To solve your issue you can initialize DPuppeteerBrowser
class for example
const browserInstance = new DPuppeteerBrowser(browser, userData, false);
const metamask = await dappeteer.setupMetaMask(browserInstance)
Hey, thanks for reaching out.
The issue is you are sending a
Browser
instance not aDappeteerBrowser
. To solve your issue you can initializeDPuppeteerBrowser
class for exampleconst browserInstance = new DPuppeteerBrowser(browser, userData, false); const metamask = await dappeteer.setupMetaMask(browserInstance)
How can we call new DPuppeteerBrowser()? What should we import to file?
I tried to add export { DPuppeteerBrowser } from "./puppeteer/browser.js"
to file @/node_modules/@chainsafe/dappeteer/dist/index.d.ts
manually, but it didn't help me
I solved it, just need to import const { DPuppeteerBrowser } = require('@chainsafe/dappeteer/dist/puppeteer/browser');
But what does userData
prop means? It has a string type, but what should I put here?
@BeroBurny, same issues on my side, I'm trying to do exactly the same thing as @Velkonost.
I this piece of code, but nothing happens:
const dappeteer = require("@chainsafe/dappeteer");
const {
DPuppeteerBrowser,
} = require("@chainsafe/dappeteer/dist/puppeteer/browser");
// function
const { port, wsEndpoint } = await openBrowser(profileId);
const browser = await puppeteer.connect({
browserWSEndpoint: `ws://127.0.0.1:${port}${wsEndpoint}`,
});
const browserInstance = new DPuppeteerBrowser(browser, "", false);
const metamask = await dappeteer.setupMetaMask(browserInstance);
await metamask.unlock(getMetamaskPassword(profileId));
What I'm trying to achieve might be different from @Velkonost, since I don't want to setup a new metamask, but rather unlock the existing instance.
I ask myself the same questions as @KIttojo: What parameters should we use in this function? new DPuppeteerBrowser(browser, userData, false);
Describe the problem I launch browser's instance from an
anty dolphin
and I have port, wsEndpoint of it. How can I connect dappeteer to this instance?System:
Part of code:
I've tried to setup like this:
but no effect