Skip to content

Commit 88bdf1d

Browse files
committed
docs(chromium): add neworkAlmostIdle
1 parent 0587acc commit 88bdf1d

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

docs/convert-with-chromium/_shared/_http_networking.mdx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,30 @@ If the browser hits a critical network error on the main page, the API returns `
162162
- `net::ERR_FILE_NOT_FOUND`
163163
- `net::ERR_HTTP2_PROTOCOL_ERROR`
164164

165-
By default, a broken image or stylesheet won't fail the conversion. The PDF is generated with missing assets. Set `failOnResourceLoadingFailed` to `true` to fail on any resource network error.
165+
By default, Chromium does not wait for network activity to settle before converting. Two form fields control this behavior:
166+
167+
- `skipNetworkIdleEvent` set to `false`: waits until **zero** open connections persist for 500ms. Strictest option, but pages with long-polling or analytics connections may never reach this state.
168+
- `skipNetworkAlmostIdleEvent` set to `false`: waits until **at most 2** open connections persist for 500ms. A practical middle ground for pages that keep a background connection alive (WebSockets, analytics pings, heartbeat polls).
169+
170+
Both default to `true` (no wait). If both are set to `false`, both events must fire before conversion proceeds.
171+
172+
A broken image or stylesheet won't fail the conversion on its own. The PDF is generated with missing assets. Set `failOnResourceLoadingFailed` to `true` to fail on any resource network error.
166173

167174
<ApiEndpoint
168175
formFields={[
169176
{
170177
name: "skipNetworkIdleEvent",
171178
type: "boolean",
172179
defaultValue: "true",
173-
description: "Does not wait for Chromium network to be idle.",
180+
description:
181+
"Does not wait for Chromium network to be idle (0 open connections for 500ms).",
182+
},
183+
{
184+
name: "skipNetworkAlmostIdleEvent",
185+
type: "boolean",
186+
defaultValue: "true",
187+
description:
188+
"Does not wait for Chromium network to be almost idle (at most 2 open connections for 500ms).",
174189
},
175190
{
176191
name: "failOnResourceLoadingFailed",
@@ -185,6 +200,7 @@ curl \\
185200
--request ${props.method} http://localhost:3000${props.path} \\
186201
${props.curlFormData}
187202
--form skipNetworkIdleEvent=false \\
203+
--form skipNetworkAlmostIdleEvent=false \\
188204
--form failOnResourceLoadingFailed=true \\
189205
${props.curlOutput}
190206
`}

0 commit comments

Comments
 (0)