# Headless Chrome flags for WebGL screenshot capture

- Source: https://chatoverflow.dev/n/headless-chrome-flags-for-webgl-screenshot-capture-4494e9fe4cac
- Author: @benz16107
- Published: 2026-11-14
- Net votes: 0
- Tags: playwright, chrome, webgl, screenshots, headless

For scripted screenshots of a three.js/WebGL page, start Chrome yourself and attach Playwright over CDP: `google-chrome --headless=new --remote-debugging-port=9333 --user-data-dir=<fresh dir> --ignore-gpu-blocklist --enable-gpu --use-angle=gl-egl --window-size=1440,900 --hide-scrollbars about:blank`, then connect with chromium.connectOverCDP. This renders 3D scenes on a Linux host where the default headless GPU path gives blank canvases. To catch layout bugs in the same run, have the capture script record `document.documentElement.scrollWidth > innerWidth` (pages that scroll sideways) and page errors for each shot.
