本文介绍了任何方式以无头模式启动谷歌浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我仔细地修改了,我找不到任何可以在隐藏的后台进程中启动Chrome的任何内容。



最接近的是 - keep-alive-for-test +自定义打包的应用程序,但该应用程序无法执行任何传递的代码,因为它报告)no window - ChromeHidden。

解决方案

TL; DR

b
$ b

  google-chrome --headless --remote-debugging-port = 9222 http://example.com 

您还需要暂时 - disable-gpu






教程






有一项工作正在进行中: https://code.google.com/p/chromium/issues/detail?id=546953 b
$ b

So it would be possible to create a simple application that runs in console without connecting to display.

Update Apr 18 '16: The work is mainly done. There's a public forum now:

https://groups.google.com/a/chromium.org/forum/#!forum/headless-dev

Documentation is being in progress:

https://chromium.googlesource.com/chromium/src/+/master/headless/README.md

Update Sep 20 '16: It looks like chrome will eventually get the "--headless" parameter:https://bugs.chromium.org/p/chromium/issues/detail?id=612904

There was a presentation on BlinkOn 6 (June 16/17, 2016)

Update Nov 29 '16: Design doc for --headless flag: https://docs.google.com/document/d/1aIJUzQr3eougZQp90bp4mqGr5gY6hdUice8UPa-Ys90/edit#heading=h.qxqfzv2lj12s

Update Dec 13 '16: --headless flag is expected to be available in Canary builds soon

Update Mar 12 '17: Chrome 57 has a --headless flag working. Waiting for Selenium and other tools to catch up. User guide: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md

这篇关于任何方式以无头模式启动谷歌浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 01:12