Forked from Forked from https://github.com/cheeaun/puppetron modified to add additional API options like custom cookies, headers, and custom wait options
Supports screenshots of pages with WebGL.
This is using Puppeteer
Puppeteer (Headless Chrome Node API)-based rendering solution.
http://screenshots.mydomain.com/
POST or GET (as url params)
Parameters:
type
- REQUIRED 'png', 'jpeg', or 'pdf'width
- page widthheight
- page heightthumbWidth
- width of thumbnail, respecting aspect ratio (no default, has to be smaller thanwidth
)fullPage
- takes a screenshot of the full scrollable page (default:false
). If the page is too long, it may time out.clipSelector
- CSS selector of element to be clipped (no default). E.g.:.weather-forecast
.cookies
- Array of cookie objectsagent
- custom user agentheaders
- Object with custom HTTP headersselector
- Wait for this selector to be present on the pageselectorOptions
- object with options includingtimeout
, see Puppeteer docs
Also passes through most parameters from Puppeteer https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md
We are using this as a private service behind a firewall, therefore some of the protections and tools from Puppetron have been removed.
I recommend reviewing and restoring some of that before deploying this publically or using it to screenshot pages with lots of media/tracking services like news articles etc.
WebGL screenshots on macOS don't work in headless mode, but will work using HEADFUL=true
or from Docker
PDFs of WebGL do not seem to work
- Node.js
- Docker
For local Chromium install:
npm install
npm start
- Load
localhost:3000
For Docker-based install:
docker build . -t puppet
docker run -p 8080:3000 puppet
- Load
localhost:8080
Forked from https://github.com/cheeaun/puppetron modified to add additional API options
Original Credits from Puppetron:
Block list from Prerender.
Inspired by zenato/puppeteer
, puppeteer-renderer
and Rendertron.