Headless Chrome REPL not working

╄→гoц情女王★ 提交于 2019-11-27 15:10:51

问题


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

Is it a bug in Chrome?


回答1:


Use the binary /opt/google/chrome/chrome directly not google-chrome which points to bash script /usr/bin/google-chrome.

Taken from comments in

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



来源:https://stackoverflow.com/questions/45939872/headless-chrome-repl-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!