Navigation

Check Network Idle

Determines whether the content has been idle for longer than a configured threshold based on recent activity timing, acknowledges the request, and sends an asynchronous runtime message containing the idle status for aggregation or further processing.

Examples

GPAL Fluent: High-level fluent C# API

//Set on the browser rather than passed to the call, so every wait in the workflow uses them. The layers below take the same three per call. WithWaitOnIdleConnection is what makes GPAL wait on the network at all, and it excludes WithWaitOnDocumentReady.

.WithNetworkIdleTimeoutMs(500) // maximum time to wait for the network to be idle

.WithNetworkIdlePruneMs(10_000) // maximum duration to keep network stats before pruning old data

.WithNetworkIdleMaxConnections(0) // max connections to consider idle

.WithWaitOnIdleConnection(true); // mutally excludes WithWaitOnDocumentReady

MagicHelper: MagicHelper utility library

//Any of the three can be left out, and what is left out comes from WithNetworkIdleMaxConnections, WithNetworkIdleTimeoutMs and WithNetworkIdlePruneMs on the browser.

// each one optional, and left unsaid it comes from what the browser was configured with

browser.MagicHelper.CheckNetworkIdle(maxConnections: 0, timeoutMs: 500, pruneMs: 10_000);


// the same question GPAL asks itself after a navigation

browser.MagicHelper.CheckNetworkIdle();

Puppeteer Client: Puppeteer-style C# client

browser.PuppeteerClient.CheckNetworkIdle()

.WithMaxConnections(0)

.WithTimeoutMs(500)

.WithPruneMs(10_000)

.Execute<bool>();

Puppeteer Communicator: Low-level communicator

//Every argument has a default: no session, zero connections, thirty seconds, and a three second prune window. The session token is how a caller waiting on one navigation ignores traffic from an earlier one.

await browser.PuppeteerCommunicator.CheckNetworkIdle(string sessionId, int maxConnections, int timeoutMs, int pruneMs, string sessionToken);

REST Client: Direct REST/HTTP client

browser.OttoMagicClient.WithEndpoint(ApiEndpoint.CheckNetworkIdle)

.WithMaxConnections(0) // connections that still count as idle

.WithTimeoutMs(500) // how long to wait for the network to settle

.WithPruneMs(10_000) // how long recorded traffic is kept before it is forgotten

.Execute();

💬 Ask GPAL