@@ -26,6 +26,15 @@ namespace OpenQA.Selenium.BiDi.Network;
2626
2727public sealed partial class NetworkModule ( Broker broker ) : Module ( broker )
2828{
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+
2938 public async Task < Intercept > AddInterceptAsync ( IEnumerable < InterceptPhase > phases , AddInterceptOptions ? options = null )
3039 {
3140 var @params = new AddInterceptParameters ( phases , options ? . Contexts , options ? . UrlPatterns ) ;
@@ -35,6 +44,13 @@ public async Task<Intercept> AddInterceptAsync(IEnumerable<InterceptPhase> phase
3544 return result . Intercept ;
3645 }
3746
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+
3854 public async Task < EmptyResult > RemoveInterceptAsync ( Intercept intercept , RemoveInterceptOptions ? options = null )
3955 {
4056 var @params = new RemoveInterceptParameters ( intercept ) ;
@@ -70,6 +86,15 @@ public async Task<EmptyResult> FailRequestAsync(Request request, FailRequestOpti
7086 return await Broker . ExecuteCommandAsync < FailRequestCommand , EmptyResult > ( new FailRequestCommand ( @params ) , options ) . ConfigureAwait ( false ) ;
7187 }
7288
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+
7398 public async Task < EmptyResult > ProvideResponseAsync ( Request request , ProvideResponseOptions ? options = null )
7499 {
75100 var @params = new ProvideResponseParameters ( request , options ? . Body , options ? . Cookies , options ? . Headers , options ? . ReasonPhrase , options ? . StatusCode ) ;
0 commit comments