hubcap waitidle

Wait for network idle (no requests for the idle duration).

When to use

Use waitidle to block until no network requests have been made for a specified duration. Use after page load to wait for async resources to finish. Use waitload for the load event specifically.

Usage

hubcap waitidle [--idle <duration>]

Arguments

None.

Flags

FlagTypeDefaultDescription
—idleduration500msTime with no network activity to consider idle

Output

FieldTypeDescription
idleboolWhether the network reached idle
{"idle":true}

Errors

ConditionExit codeStderr
Chrome not connected2error: connecting to Chrome: ...
Network not idle within timeout3error: timeout

Examples

Wait for network idle with default 500ms threshold:

hubcap waitidle

Wait for a longer period of inactivity:

hubcap waitidle --idle 2s

Navigate and wait for all async resources to load (chaining):

hubcap goto https://example.com && hubcap waitidle --idle 1s

See also

  • waitload - Wait for the page load event
  • waitnav - Wait for any navigation event
  • network - Monitor network activity
  • goto - Navigate to a URL