@@ -30,7 +30,7 @@ public async Task<Interception> InterceptRequestAsync(Func<InterceptedRequest, T
3030 {
3131 var interceptResult = await AddInterceptAsync ( [ InterceptPhase . BeforeRequestSent ] , options ) . ConfigureAwait ( false ) ;
3232
33- Interception interception = new ( BiDi , interceptResult . Intercept ) ;
33+ Interception interception = new ( this , interceptResult . Intercept ) ;
3434
3535 await interception . OnBeforeRequestSentAsync ( async req => await handler ( new ( req . BiDi , req . Context , req . IsBlocked , req . Navigation , req . RedirectCount , req . Request , req . Timestamp , req . Initiator , req . Intercepts ) ) ) . ConfigureAwait ( false ) ;
3636
@@ -41,7 +41,7 @@ public async Task<Interception> InterceptResponseAsync(Func<InterceptedResponse,
4141 {
4242 var interceptResult = await AddInterceptAsync ( [ InterceptPhase . ResponseStarted ] , options ) . ConfigureAwait ( false ) ;
4343
44- Interception interception = new ( BiDi , interceptResult . Intercept ) ;
44+ Interception interception = new ( this , interceptResult . Intercept ) ;
4545
4646 await interception . OnResponseStartedAsync ( async res => await handler ( new ( res . BiDi , res . Context , res . IsBlocked , res . Navigation , res . RedirectCount , res . Request , res . Timestamp , res . Response , res . Intercepts ) ) ) . ConfigureAwait ( false ) ;
4747
@@ -52,7 +52,7 @@ public async Task<Interception> InterceptAuthAsync(Func<InterceptedAuth, Task> h
5252 {
5353 var interceptResult = await AddInterceptAsync ( [ InterceptPhase . AuthRequired ] , options ) . ConfigureAwait ( false ) ;
5454
55- Interception interception = new ( BiDi , interceptResult . Intercept ) ;
55+ Interception interception = new ( this , interceptResult . Intercept ) ;
5656
5757 await interception . OnAuthRequiredAsync ( async auth => await handler ( new ( auth . BiDi , auth . Context , auth . IsBlocked , auth . Navigation , auth . RedirectCount , auth . Request , auth . Timestamp , auth . Response , auth . Intercepts ) ) ) . ConfigureAwait ( false ) ;
5858
@@ -128,15 +128,15 @@ public Task ContinueAsync(ContinueWithAuthCancelCredentialsOptions? options = nu
128128 }
129129}
130130
131- public sealed record Interception ( BiDi BiDi , Intercept Intercept ) : IAsyncDisposable
131+ public sealed record Interception ( NetworkModule Network , Intercept Intercept ) : IAsyncDisposable
132132{
133133 IList < Subscription > OnBeforeRequestSentSubscriptions { get ; } = [ ] ;
134134 IList < Subscription > OnResponseStartedSubscriptions { get ; } = [ ] ;
135135 IList < Subscription > OnAuthRequiredSubscriptions { get ; } = [ ] ;
136136
137137 public async Task RemoveAsync ( )
138138 {
139- await BiDi . Network . RemoveInterceptAsync ( Intercept ) . ConfigureAwait ( false ) ;
139+ await Network . RemoveInterceptAsync ( Intercept ) . ConfigureAwait ( false ) ;
140140
141141 foreach ( var subscription in OnBeforeRequestSentSubscriptions )
142142 {
@@ -156,21 +156,21 @@ public async Task RemoveAsync()
156156
157157 public async Task OnBeforeRequestSentAsync ( Func < BeforeRequestSentEventArgs , Task > handler , SubscriptionOptions ? options = null )
158158 {
159- var subscription = await BiDi . Network . OnBeforeRequestSentAsync ( async args => await Filter ( args , handler ) , options ) . ConfigureAwait ( false ) ;
159+ var subscription = await Network . OnBeforeRequestSentAsync ( async args => await Filter ( args , handler ) , options ) . ConfigureAwait ( false ) ;
160160
161161 OnBeforeRequestSentSubscriptions . Add ( subscription ) ;
162162 }
163163
164164 public async Task OnResponseStartedAsync ( Func < ResponseStartedEventArgs , Task > handler , SubscriptionOptions ? options = null )
165165 {
166- var subscription = await BiDi . Network . OnResponseStartedAsync ( async args => await Filter ( args , handler ) , options ) . ConfigureAwait ( false ) ;
166+ var subscription = await Network . OnResponseStartedAsync ( async args => await Filter ( args , handler ) , options ) . ConfigureAwait ( false ) ;
167167
168168 OnResponseStartedSubscriptions . Add ( subscription ) ;
169169 }
170170
171171 public async Task OnAuthRequiredAsync ( Func < AuthRequiredEventArgs , Task > handler , SubscriptionOptions ? options = null )
172172 {
173- var subscription = await BiDi . Network . OnAuthRequiredAsync ( async args => await Filter ( args , handler ) , options ) . ConfigureAwait ( false ) ;
173+ var subscription = await Network . OnAuthRequiredAsync ( async args => await Filter ( args , handler ) , options ) . ConfigureAwait ( false ) ;
174174
175175 OnAuthRequiredSubscriptions . Add ( subscription ) ;
176176 }
0 commit comments