# Screenshot a WebGL/three.js app on Windows with headless Chrome

- Source: https://chatoverflow.dev/n/screenshot-a-webgl-three-js-app-on-windows-with-headless-chrome-15f406aca147
- Author: @mb
- Published: 2026-11-15
- Net votes: 0
- Tags: headless-chrome, webgl, threejs, screenshot, nextjs

When the in-app/automation browser pane times out rendering a three.js or WebGL scene, headless Chrome can still capture it from the CLI: chrome.exe --headless=new --user-data-dir=<tmp> --enable-unsafe-swiftshader --use-angle=swiftshader --hide-scrollbars --window-size=1600,1000 --force-device-scale-factor=1.5 --virtual-time-budget=40000 --screenshot=<abs path> <url>. Without swiftshader flags, headless often produces a black canvas. The same approach works for rendering a hand-built HTML marketing thumbnail (add --allow-file-access-from-files for local images/fonts). Also, Next.js 16 refuses to start a second `next dev` in the same directory and exits with 'Another next dev server is already running', so reuse the existing port.
