Chrome 73 停止支持后台计划任务中的无头模式? [英] Chrome 73 stop supporting headless mode in background scheduled task?

查看:83
本文介绍了Chrome 73 停止支持后台计划任务中的无头模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个 .NET 程序来运行无头 Chrome 来将网页快照到图像,这里是示例代码:

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();
    }
}

控制台应用程序在 Windows 任务计划程序中使用无论用户是否登录都运行"选项进行计划.该程序运行良好,但昨天失败了,我们注意到 Chrome 版本现在是 73.幸好我们找到一台Chrome还是72的电脑,于是我们测试了一次后台定时任务,把Chrome升级到73再测试,终于得出结论——Headless Chrome 72可以后台运行,但是Chrome 73可以't.

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.

有人在 Chrome 73 上发现同样的问题吗?

Does anybody find the same issue on Chrome 73?

[更新于 2019/6/23]

这是 Chromium 的错误(错误 942023)并已在 Chrome 74.0.3729.108 上修复.

It's a bug of Chromium (bug 942023) and has been fixed on Chrome 74.0.3729.108.

对于 Chrome 73,您可以使用 --disable-features=VizDisplayCompositor 参数作为解决方法.

For Chrome 73, you can use --disable-features=VizDisplayCompositor argument as a workaround.

推荐答案

是的,我们在这里遇到了同样的问题.我们通过 Selenium WebDriver 运行 Chrome,在更新到 Chrome 73 后,我们的后台任务不再正常运行.降级到 Chrome 72 解决了这个问题.

Yes, we have the same issue here. We're running Chrome through Selenium WebDriver and after the update to Chrome 73 our background tasks no longer function correctly. Downgrading to Chrome 72 fixes the problem.

我们的诊断日志显示,在无头模式下运行 Chrome 73 时,对 Chrome 进程的某些调用似乎挂起.例如,调整浏览器大小或尝试通过 WebDriver API 截取屏幕截图.我们尝试了很多方法来解决这个问题,包括将 Selenium、WebDriver 和 chromedriver 更新到最新版本,但它们的行为都相同.

Our diagnostics logs show that when running Chrome 73 in headless mode that certain calls to the Chrome process seem to hang. For instance, resizing the browser or trying to take a screenshot via the WebDriver API. We tried a number of things to fix this including updating Selenium, WebDriver and chromedriver to the latest versions but all had identical behaviours.

更新后在无头模式下运行 Chrome 73 肯定存在问题.

There certainly seems to be an issue with running Chrome 73 in headless mode after the update.

这篇关于Chrome 73 停止支持后台计划任务中的无头模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆