browser_wait_for_network_idle
POST /api/execute/browser_wait_for_network_idleBlocks automation progress until inflight HTTP, Fetch, and XMLHttpRequest connections remain at zero for a quiet window. The Chromium resource dispatcher tracks active socket requests, stylesheet downloads, script fetches, and asynchronous API calls initiated by the document. Every time the pending connection counter drops to zero, an internal countdown starts for the specified silence threshold. If a lazy-loaded image or script initiates another transfer before that countdown finishes, the timer resets and continues monitoring. When silence persists across the entire threshold, the command resolves with elapsed duration metadata. Should background polling, Server-Sent Events, or WebSocket heartbeats prevent quietness before the deadline expires, a timeout error is returned. This synchronization mechanism guarantees that dynamic single-page views finish hydrating data before extraction begins.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| context_id | string | yes | Target session identifier monitored for pending HTTP and asynchronous fetch activity. |
| idle_time | string | no | Continuous quiet period in milliseconds with zero active transfers required to declare readiness. |
| timeout | string | no | Maximum millisecond deadline to await connection quiescence before aborting with an error. |
Usage
result = await browser.wait_for_network_idle(context_id=context_id)