How to set timeout for headless chrome

Viewed 7116

I try:

chrome --timeout 15000 .....

And if chrome doesn't finish in 15 seconds it should finish immediately.

But when i run

chrome --headless --disable-gpu --timeout 30000 --dump-dom http://example.com

I get

[1110/120048.838007:ERROR:headless_shell.cc(603)] Open multiple tabs is only supported when remote debugging is enabled.

It works w/o --timeout flag

Chrome Canary v64 OSX

Update at 2019 Nov.

I noticed this question gets a consistent flow of views and still provides no to little value. I wanted to update that now I use puppeteer, which is project from Google itself to use headless Chrome with NodeJs and it's really easy and straight forward API. If you are OK to use NodeJs - check it.

https://github.com/GoogleChrome/puppeteer

3 Answers

You need to place the --timeout flag before the --headless flag

chrome --timeout 30000 --headless --disable-gpu --dump-dom http://example.com

Working only with = on macOs

chrome --timeout=30000 --headless --disable-gpu --dump-dom http://example.com
Related