From b7738ffdd5f8ec7d34e9c25577fe299fcd45f4ec Mon Sep 17 00:00:00 2001 From: "Tommy D. Rossi" Date: Thu, 15 Jan 2026 13:23:28 +0100 Subject: [PATCH] tell about using css scale for screenshots --- playwriter/src/prompt.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/playwriter/src/prompt.md b/playwriter/src/prompt.md index 9e400c7..f01c084 100644 --- a/playwriter/src/prompt.md +++ b/playwriter/src/prompt.md @@ -291,6 +291,14 @@ const el = await page.evaluateHandle(() => globalThis.playwriterPinnedElem1); await el.click(); ``` +## taking screenshots + +Always use `scale: 'css'` to avoid 2-4x larger images on high-DPI displays: + +```js +await page.screenshot({ path: 'shot.png', scale: 'css' }); +``` + ## page.evaluate Code inside `page.evaluate()` runs in the browser - use plain JavaScript only, no TypeScript syntax. Return values and log outside (console.log inside evaluate runs in browser, not visible):