Version
1.49.0
Steps to reproduce
I'm running playwright in a container that is connecting to the Chrome started on the host machine like so:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug --remote-allow-origins="*"
I'm connecting to it from playwright roughly like so:
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.connectOverCDP('ws://host.docker.internal:9222/devtools/browser/24923805-d4d0-48de-805c-bae17bd4c386');
const context = browser.contexts()[0] || await browser.newContext();
const page = context.pages()[0] || await context.newPage();
// Listen for download event
page.on('download', async (download) => {
const path = await download.path();
const suggestedFilename = download.suggestedFilename();
await download.saveAs("/tmp/workspaces/file.pdf");
console.log(`Downloaded file saved as: ${savePath}`);
});
console.log('Connected to Chrome via CDP');
await page.goto('https://some-test.site');
await page.click("#downloadLink")
})();
Expected behavior
Should save the file to "/tmp/workspaces/file.pdf on the machine running playwright.
Actual behavior
An exception happens.
Error: download.saveAs: ENOENT: no such file or directory, copyfile '/tmp/playwright-artifacts-MedLPD/537add71-ff6a-4dfa-85e7-f6f2f68080f8'
Same thing happens when trying to use the stream.
After further investigation, it looks like it tries to copy the file locally(on the machine running playwright) instead of getting the file over the CDP protocol.
Additional context
Environment
System:
OS: Linux 6.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
CPU: (14) arm64 unknown
Memory: 20.96 GB / 31.29 GB
Container: Yes
Binaries:
Node: 18.19.0 - /usr/local/bin/node
Yarn: 4.0.1 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.1 - /usr/local/share/npm-global/bin/pnpm
IDEs:
VSCode: 1.96.4 - /vscode/vscode-server/bin/linux-arm64/cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba/bin/remote-cli/code
Languages:
Bash: 5.1.4 - /bin/bash
Version
1.49.0
Steps to reproduce
I'm running playwright in a container that is connecting to the Chrome started on the host machine like so:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug --remote-allow-origins="*"I'm connecting to it from playwright roughly like so:
Expected behavior
Should save the file to
"/tmp/workspaces/file.pdfon the machine running playwright.Actual behavior
An exception happens.
Error: download.saveAs: ENOENT: no such file or directory, copyfile '/tmp/playwright-artifacts-MedLPD/537add71-ff6a-4dfa-85e7-f6f2f68080f8'
Same thing happens when trying to use the stream.
After further investigation, it looks like it tries to copy the file locally(on the machine running playwright) instead of getting the file over the CDP protocol.
Additional context
Environment
System: OS: Linux 6.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye) CPU: (14) arm64 unknown Memory: 20.96 GB / 31.29 GB Container: Yes Binaries: Node: 18.19.0 - /usr/local/bin/node Yarn: 4.0.1 - /usr/local/bin/yarn npm: 10.2.3 - /usr/local/bin/npm pnpm: 8.15.1 - /usr/local/share/npm-global/bin/pnpm IDEs: VSCode: 1.96.4 - /vscode/vscode-server/bin/linux-arm64/cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba/bin/remote-cli/code Languages: Bash: 5.1.4 - /bin/bash