Merge pull request #2618 from lightpanda-io/wait_until_networkalmostidle

Add "networkalmostidle" to --wait-until parameter
This commit is contained in:
Karl Seguin authored and GitHub committed 2026-06-03 15:58:15 +08:00
commit bfad022452
3 files changed
+6 -1

No files matched your search

+1
View File
@@ -460,6 +460,7 @@ pub const DumpFormat = enum {
pub const WaitUntil = enum {
load,
domcontentloaded,
networkalmostidle,
networkidle,
done,
};
+3
View File
@@ -205,6 +205,9 @@ fn _tick(self: *Runner, comptime is_cdp: bool, opts: TickOpts) !TickResult {
.networkidle => if (frame._notified_network_idle == .done) {
return .done;
},
.networkalmostidle => if (frame._notified_network_almost_idle == .done) {
return .done;
},
}
if (http_active == 0 and http_next_tick == 0 and http_client.ws_active == 0 and http_client.queue.first == null and http_client.ready_queue.first == null and (comptime is_cdp) == false) {
+2 -1
View File
@@ -77,7 +77,8 @@
\\ Wait until the specified event. Checked before other --wait-* options.
\\ Defaults to 'done'. If --wait-selector, --wait-script or
\\ --wait-script-file specified, defaults to none.
\\ Allowed values: "load", "domcontentloaded", "networkidle", "done".
\\ Allowed values: "load", "domcontentloaded", "networkalmostidle",
\\ "networkidle", "done".
\\ --wait-selector <QUERY>
\\ Wait for an element matching the CSS selector to appear. Checked after
\\ --wait-until condition is met.