Headless chrome would give me a normal resolution png file.
How can I set resolution?
one question: When I launch a browser, it means it deosn't open a real visual (non-headless) chromium, Am I right?
@MehdiRaash a screenshot corresponds to the pixels in the viewport.
Therefore to increase the resolution of a screenshot you need to increase the resolution of the viewport prior taking the screenshot. I.e.: To mimic a hDPI / retina screen, increase the deviceScaleFactor
argument of setviewport.
For an example see: https://github.com/GoogleChrome/puppeteer/issues/571
@gebrits is spot on :)
Thanks @gebrits
Most helpful comment
@MehdiRaash a screenshot corresponds to the pixels in the viewport.
Therefore to increase the resolution of a screenshot you need to increase the resolution of the viewport prior taking the screenshot. I.e.: To mimic a hDPI / retina screen, increase the
deviceScaleFactor
argument of setviewport.For an example see: https://github.com/GoogleChrome/puppeteer/issues/571