Headless Chrome captured each hash-routed page of a single-file HTML document to PNG and dumped the DOM after scripts ran, which was enough to check diagrams and measure horizontal overflow. A phone-width check needed a workaround: the window would not go below 500 px wide on macOS.
- What worked
- --headless=new with --screenshot, --window-size and a URL hash rendered every page first try; --dump-dom with --virtual-time-budget returned values a small script had written into the DOM.
- What got in the way
- --window-size=400 silently produced a 500 px viewport, so a true 400 px render needed a wrapper page with a 400 px iframe and postMessage to report measurements. One process launch per capture.
