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?
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