@@ -26,6 +26,15 @@ namespace OpenQA.Selenium.BiDi.Network;
26
26
27
27
public sealed partial class NetworkModule ( Broker broker ) : Module ( broker )
28
28
{
29
+ public async Task < Collector > AddDataCollectorAsync ( IEnumerable < DataType > DataTypes , int MaxEncodedDataSize , AddDataCollectorOptions ? options = null )
30
+ {
31
+ var @params = new AddDataCollectorParameters ( DataTypes , MaxEncodedDataSize , options ? . CollectorType , options ? . Contexts , options ? . UserContexts ) ;
32
+
33
+ var result = await Broker . ExecuteCommandAsync < AddDataCollectorCommand , AddDataCollectorResult > ( new AddDataCollectorCommand ( @params ) , options ) . ConfigureAwait ( false ) ;
34
+
35
+ return result . Collector ;
36
+ }
37
+
29
38
public async Task < Intercept > AddInterceptAsync ( IEnumerable < InterceptPhase > phases , AddInterceptOptions ? options = null )
30
39
{
31
40
var @params = new AddInterceptParameters ( phases , options ? . Contexts , options ? . UrlPatterns ) ;
@@ -35,6 +44,13 @@ public async Task<Intercept> AddInterceptAsync(IEnumerable<InterceptPhase> phase
35
44
return result . Intercept ;
36
45
}
37
46
47
+ public async Task < EmptyResult > RemoveDataCollectorAsync ( Collector collector , RemoveDataCollectorOptions ? options = null )
48
+ {
49
+ var @params = new RemoveDataCollectorParameters ( collector ) ;
50
+
51
+ return await Broker . ExecuteCommandAsync < RemoveDataCollectorCommand , EmptyResult > ( new RemoveDataCollectorCommand ( @params ) , options ) . ConfigureAwait ( false ) ;
52
+ }
53
+
38
54
public async Task < EmptyResult > RemoveInterceptAsync ( Intercept intercept , RemoveInterceptOptions ? options = null )
39
55
{
40
56
var @params = new RemoveInterceptParameters ( intercept ) ;
@@ -70,6 +86,15 @@ public async Task<EmptyResult> FailRequestAsync(Request request, FailRequestOpti
70
86
return await Broker . ExecuteCommandAsync < FailRequestCommand , EmptyResult > ( new FailRequestCommand ( @params ) , options ) . ConfigureAwait ( false ) ;
71
87
}
72
88
89
+ public async Task < BytesValue > GetDataAsync ( DataType dataType , Request request , GetDataOptions ? options = null )
90
+ {
91
+ var @params = new GetDataParameters ( dataType , request , options ? . Collector , options ? . Disown ) ;
92
+
93
+ var result = await Broker . ExecuteCommandAsync < GetDataCommand , GetDataResult > ( new GetDataCommand ( @params ) , options ) . ConfigureAwait ( false ) ;
94
+
95
+ return result . Bytes ;
96
+ }
97
+
73
98
public async Task < EmptyResult > ProvideResponseAsync ( Request request , ProvideResponseOptions ? options = null )
74
99
{
75
100
var @params = new ProvideResponseParameters ( request , options ? . Body , options ? . Cookies , options ? . Headers , options ? . ReasonPhrase , options ? . StatusCode ) ;
0 commit comments