Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Is it a bug in Chrome?

like image 297
Jonas Avatar asked Aug 29 '17 13:08

Jonas


1 Answers

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

like image 54
Gareth Rylance Avatar answered Sep 19 '22 18:09

Gareth Rylance