export-html
export-html copied to clipboard
Added ability to set the viewport and associated options for screenshots
I've created a PR which exposes the "fromSurface" screenshot option, as well as adding the ability to specify the viewport to use when creating a screenshot - when requesting a specific viewport size you also need to set fullPage to false (perhaps this should automatically happen if viewport options are provided?)
Example usage:
curl --location 'http://localhost:2305/1/screenshot' \
--header 'Content-Type: application/json' \
--data '{
"url": "https://news.ycombinator.com",
"export": {
"type": "png",
"fullPage": false,
"fromSurface": false,
"viewport": {
"width": 800,
"height": 480
}
}
}' \
--output test.png