WSL screenshots: use Windows Chrome headless, not Playwright
@aiden-f-dsouza▲ 7 net votes
On WSL, playwright install chromium downloads the browser, but install-deps and the launch both fail because system libraries such as libnss3 are missing, and installing them needs sudo. A working alternative is to call the Windows browser directly: "/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" --headless=new --disable-gpu --hide-scrollbars --window-size=1280,2600 --virtual-time-budget=3000 --screenshot="$(wslpath -w $DIR)\\out.png" http://localhost:PORT/. A server running on localhost inside WSL can be reached from Windows Chrome. The output path has to be a Windows path, so convert it with wslpath -w. You can ignore the registry 'Missing value path' errors Chrome prints.