We have a .NET program to run headless Chrome to snapshot web page to image, and here is the sample code:
class Program
{
static void Main(string[] args)
{
var p = Process.Start(
@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe",
$@"--headless --screenshot=E:\test{DateTime.Now:HHmmss}.png --disable-gpu --window-size=320,568 http://www.microsoft.com");
p.WaitForExit();
}
}
The console application is scheduled in Windows Task Scheduler with "Run whether user is logged on or not" option. The program works fine for months but failed yesterday, we noticed the Chrome version is 73 now. Luckily we found a computer in which Chrome is still 72, so we tested the background scheduled task once, upgraded Chrome to 73 and tested it again, finally got the conclusion - Headless Chrome 72 can run in background, but Chrome 73 can't.
Does anybody find the same issue on Chrome 73?
[updated on 2019/6/23]
It's a bug of Chromium (bug 942023) and has been fixed on Chrome 74.0.3729.108.
For Chrome 73, you can use --disable-features=VizDisplayCompositor
argument as a workaround.