lino-levan / astral

A high-level puppeteer/playwright-like library for Deno
https://jsr.io/@astral/astral
MIT License
176 stars 7 forks source link

add `element.evaluate` #44

Closed teawinzero closed 7 months ago

lino-levan commented 7 months ago

@lowlighter we're getting pretty consistent issues with booting the binary recently on windows. Any ideas on why that might be happening?

teawinzero commented 7 months ago

I can assume the problem is in the shared folder when starting the process

This can be solved using the --user-data-dir= argument. Note: Files with a total size of ~60MB are created in the specified folder. Which will need to be cleaned later if this is not a permanent profile.

https://github.com/microsoft/playwright/blob/11bf96fe98decb99a6abd08578b4d27c06e49cd9/packages/playwright-core/src/server/chromium/chromium.ts#L282

chromeArguments.push(`--user-data-dir=${userDataDir}`);

https://github.com/microsoft/playwright/blob/11bf96fe98decb99a6abd08578b4d27c06e49cd9/packages/playwright-core/src/server/browserType.ts#L161

userDataDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), `playwright_${this._name}dev_profile-`));
lino-levan commented 7 months ago

Wow! This has been a consistent issue we've been facing forever. This definitely looks to be it. Would you be willing to PR this or should I?

lino-levan commented 7 months ago

Should just be a Deno.makeTempDir + passing this argument.

lino-levan commented 7 months ago

I'll open a PR

lino-levan commented 7 months ago

@teawinzero could you merge this into main?