API to puppeteer - chromium.
screenshot.js is a NodeJS request-response-handler to generate screenshots.
puppeteer tries to use locally available chromium (by chrome-aws-lambda) otherwise tries to fall back to connect to PUPPETEER_WS_ENDPOINT
see [.env.example]
now -e URL_ALLOWLIST=https://republik.ch,https://www.republik.ch,https://republik.love,https://www.republik.love,https://github.com
- screenshot.js
- example query:
/?url=:url[&width=:w][&heigth=:h][&zoomFactor=:sf][&fullPage=:fp][&format=:f][&quality=:q][&cookie=:c][&basicAuthUser=:u][&basicAuthPass=:p]
- renders ?url
- optional &width &height
- default
1200x1
- default
- optional &fullPage
- default
1
- this api screenshots the full page per default (with scrolling), set
fullPage
to0
to crop to viewport
- default
- optional &zoomFactor
- default 1
- optional &cookie
- example: 'id=something'
- optional &basicAuthUser &basicAuthPass
- send basic auth when requesting ?url
- optional &format
- default
png
- supports
png
,jpeg
- default
- optional &quality
- only for
jpeg
- only for
- example query:
Inspired by: now-examples puppeteer-screenshot