cyrus-and / chrome-har-capturer

Capture HAR files from a Chrome instance
MIT License
535 stars 90 forks source link

can this have a timeout option? #26

Closed c0b closed 8 years ago

c0b commented 8 years ago

for some reason, either server side slow or client side network congestion, some pages seemingly take for ever to fully load, in this case can we have a timeout option to give up? I have a PR if this feature is agreed useful

Usage: chrome-har-capturer [options] URL...

Options:

  -h, --help           output usage information
  -t, --host <host>    Remote Debugging Protocol host
  -p, --port <port>    Remote Debugging Protocol port
  -o, --output <file>  dump to file instead of stdout
  -c, --content        also capture the requests body
  -a, --agent <agent>  user agent override
  -d, --delay <ms>     time to wait after the load event
      --timeout <seconds>  Wait at most how many seconds before giving up
  -f, --force          continue even without benchmarking extension
  -v, --verbose        enable verbose output on stderr
c0b commented 8 years ago

I mean the load API better to have a timeout option

https://github.com/cyrus-and/chrome-har-capturer#loadurls-options load(urls, [options])

cyrus-and commented 8 years ago

Yes I think this would be a useful addition. I'd suggest the names: -g, --give-up for the command line and giveUpTimeout for the API.

Anyway, next time it happens, try to check whether the page is actually not loading or chrome-har-capturer fails to detect the event.

c0b commented 8 years ago

:+1: