简体   繁体   English

无头 Chrome REPL 不起作用

[英]Headless Chrome REPL not working

When I try to run:当我尝试运行时:

google-chrome --headless --disable-gpu --repl http://google.com

getting infinite:获得无限:

[0829/155519.758686:INFO:headless_shell.cc(303)] Type a Javascript expression to evaluate or "quit" to exit.
>>> {"result":{"type":"undefined"}}
>>> {"result":{"type":"undefined"}}
>>> {"result":{"type":"undefined"}}
>>> {"result":{"type":"undefined"}}
...

Google Chrome 60.0.3112.113 on Ubuntu 16.04 Ubuntu 16.04 上的谷歌浏览器 60.0.3112.113

Is it a bug in Chrome?这是Chrome中的错误吗?

Use the binary /opt/google/chrome/chrome directly not google-chrome which points to bash script /usr/bin/google-chrome.直接使用二进制文件 /opt/google/chrome/chrome 而不是指向 bash 脚本 /usr/bin/google-chrome 的 google-chrome。

Taken from comments in摘自评论中

https://developers.google.com/web/updates/2017/04/headless-chrome#screenshots https://developers.google.com/web/updates/2017/04/headless-chrome#screenshots

type this输入这个

 alias chrome=/opt/google/chrome/chrome

then use chrome然后使用铬

 chrome --headless --disable-gpu --repl http://google.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM