Skip to content

Commit f19e6e5

Browse files
Guillaume DUHRGuillaume DUHR
authored andcommitted
Add skipNetworkIdle flag
1 parent e72ab5d commit f19e6e5

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

lib/Domain/Builders/Faceted/HtmlConversionBehaviorBuilder.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,18 @@ public HtmlConversionBehaviorBuilder EmulateAsScreen()
143143
return this;
144144
}
145145

146+
/// <summary>
147+
/// Configures gotenberg to not wait for Chromium network to be idle
148+
/// </summary>
149+
/// <returns></returns>
150+
[PublicAPI]
151+
public HtmlConversionBehaviorBuilder SkipNetworkIdleEvent()
152+
{
153+
this._htmlConversionBehaviors.SkipNetworkIdleEvent = true;
154+
155+
return this;
156+
}
157+
146158
/// <summary>
147159
/// Sets the format of the resulting PDF document
148160
/// </summary>

lib/Domain/Requests/Facets/HtmlConversionBehaviors.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ public class HtmlConversionBehaviors : IConvertToHttpContent
7878
[MultiFormHeader(Constants.Gotenberg.Chromium.Shared.HtmlConvert.EmulatedMediaType)]
7979
public string? EmulatedMediaType { [UsedImplicitly] get; set; }
8080

81+
/// <summary>
82+
/// Do not wait for chromium network idle event before converting.
83+
/// </summary>
84+
[MultiFormHeader(Constants.Gotenberg.Chromium.Shared.HtmlConvert.SkipNetworkIdleEvent)]
85+
public bool SkipNetworkIdleEvent { [UsedImplicitly] get; set; }
86+
8187
/// <summary>
8288
/// After a Chromium conversion, the PDF engines will convert the resulting PDF to a specific format.
8389
/// </summary>

lib/Infrastructure/Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,8 @@ public static class HtmlConvert
253253
//css
254254
public const string EmulatedMediaType = "emulatedMediaType";
255255

256+
public const string SkipNetworkIdleEvent = "skipNetworkIdleEvent";
257+
256258
//pdf format
257259
public const string PdfFormat = CrossCutting.PdfFormat;
258260
}

0 commit comments

Comments
 (0)