

If no value is provided, takeScreenshot() will create a full page PNG of the given URL. Second, we've included a new parameter in our exported function takeScreenshot: emulateMobile.

You can change the default image format from PNG to JPEG, along with many other options described in the page.screenshot() documentation.

fullPage is set to true, generating a PNG of the entire web page instead of just what’s seen in a browser window.

First, page.screenshot() comes with its own set of parameters that can be modified. There are a few new things happening here. Open a new page to the given url and take the screenshot Using Puppeteer with the Platform.sh Config Reader library requires Node.js 10 or later type: nodejs:10Īnd that both libraries are included in your package.json dependencies: "dependencies": ) platform/services.yaml: headless:Īlong with a complementary relationship definition in. First, define the chrome-headless container in your. Headless Chrome can be configured on an existing Platform.sh project like any other of our maintained services. In this post, we'll show you how to configure Headless Chrome on a project, and then build an ExpressJS application that shows off some of the cool new capabilities your applications can have with a headless browser at its disposal.
