InstanceExtensions (Traffic)
static class · namespace z3n7 · source Traffic/CdpHar.cs, Traffic/Traffic.cs
public static class InstanceExtensions
Other parts of this type: InstanceExtensions (Browser)
Extension methods on Instance: HAR recording over DevTools.
Methods
GrabTrafficList
public static List<Traffic.TrafficElement> GrabTrafficList(this Instance instance, string url, bool strict = false)
Extension method for Instance. source
Returns the requests recorded so far whose URL matches url. The same text is used as the traffic filter.
| Parameter | Description |
|---|---|
url |
Text to look for in the URL. |
strict |
Require an exact URL match. |
SaveHar
public static int SaveHar(this Instance instance, string path, string urlRegex = null)
Extension method for Instance. source
Writes the traffic recorded since StartHar to a HAR file. See CdpHar.Save.
| Parameter | Description |
|---|---|
path |
Target file. |
urlRegex |
Case-insensitive regex the URL must match; null keeps everything. |
Returns: Number of entries written. Throws when the recorder was not started.
StartHar
public static CdpHar StartHar(this Instance instance)
Extension method for Instance. source
Starts HAR recording over DevTools for this instance. Call BEFORE the traffic you need.
StopHar
public static void StopHar(this Instance instance)
Extension method for Instance. source
Stops HAR recording for this instance.