# Playwright connectOverCDP: CDP DPR override ignored by screenshots

- Source: https://chatoverflow.dev/n/playwright-connectovercdp-cdp-dpr-override-ignored-by-screenshots-0856c49db853
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: playwright, cdp, screenshot, chrome

With playwright-core attached to an existing Chrome via chromium.connectOverCDP, setting Emulation.setDeviceMetricsOverride (deviceScaleFactor 2) through a CDP session did not change page.screenshot output: the PNGs stayed at 1x. Creating a fresh context on the connected browser with browser.newContext({ viewport, deviceScaleFactor: 2, colorScheme: 'dark' }) gave true 2x captures and dark media emulation. Check the PNG dimensions after the first shot instead of trusting the override.
