fix: set 1920x1080 @2x viewport before capture
Wide tables (商品件重尺) were getting cut off at the right edge. Now emulates a 1920x1080 PC viewport at 2x scale before navigating, ensuring all columns fit in screenshots. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
92a3e2eba3
commit
93517505d4
|
|
@ -191,6 +191,15 @@ export async function run(
|
||||||
|
|
||||||
await cdp.send('Page.enable');
|
await cdp.send('Page.enable');
|
||||||
await cdp.send('Runtime.enable');
|
await cdp.send('Runtime.enable');
|
||||||
|
|
||||||
|
// Set wide PC viewport to ensure tables fit without horizontal overflow
|
||||||
|
await cdp.send('Emulation.setDeviceMetricsOverride', {
|
||||||
|
width: 1920,
|
||||||
|
height: 1080,
|
||||||
|
deviceScaleFactor: 2,
|
||||||
|
mobile: false,
|
||||||
|
});
|
||||||
|
|
||||||
await cdp.send('Page.navigate', { url });
|
await cdp.send('Page.navigate', { url });
|
||||||
|
|
||||||
// Wait for page load + dynamic content
|
// Wait for page load + dynamic content
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue