是否可以使用扩展程序以无头模式运行Google Chrome? [英] Is it possible to run Google Chrome in headless mode with extensions?

查看:415
本文介绍了是否可以使用扩展程序以无头模式运行Google Chrome?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Google Chrome中使用我目前安装的扩展程式,并使用无头模式。有什么方法可以启用它们?



检查扩展是否工作的一种简单方法是添加例如



但是,如果我使用无头模式( google-chrome --headless --disable-gpu --screenshot https://www.google。 com ),结果是:

不,这不可能,Chrome开发人员由于任务的复杂性,决定在不久的将来实施它

如果你看到这个问题,你可能会认为他们仍然在考虑ChromeDriver的要求 - 但他们决定让ChromeDriver在没有扩展的情况下工作DevTools)。


I cannot use my currently installed extensions in Google Chrome using headless mode. Is there any way to enable them?

An easy way to check if the extensions work is by adding, for example, the "Comic Sans Everything" extension.

So Google looks like that:

However, if I take a screenshot of the page using the headless mode (google-chrome --headless --disable-gpu --screenshot https://www.google.com), the result is:

解决方案

No, it's not possible, and Chrome developers decided against implementing it in any near future due to complexity of the task.

If you look at that issue you may get the idea that they are still considering it due to ChromeDriver requirements - but instead they decided to make ChromeDriver work without extensions (through DevTools).

这篇关于是否可以使用扩展程序以无头模式运行Google Chrome?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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