[dotnet] [bidi] Remove high-level network interception#17288
Merged
nvborisenko merged 2 commits intoSeleniumHQ:trunkfrom Apr 1, 2026
Merged
[dotnet] [bidi] Remove high-level network interception#17288nvborisenko merged 2 commits intoSeleniumHQ:trunkfrom
nvborisenko merged 2 commits intoSeleniumHQ:trunkfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the .NET BiDi Network interception API by removing the high-level Intercept*Async(...) helpers and their related types, pushing consumers toward AddInterceptAsync(...) plus explicit event subscriptions.
Changes:
- Removed high-level interception methods/types from
NetworkModule,BrowsingContextNetworkModule, and their interfaces. - Deleted the
NetworkModule.HighLevel.csimplementation (including theInterceptionhelper wrapper andIntercepted*event-arg wrappers). - Updated BiDi network tests to use
AddInterceptAsync(...)andOn*Async(...)subscriptions.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| dotnet/test/webdriver/BiDi/Network/NetworkTests.cs | Migrates interception tests to the lower-level intercept + event subscription model. |
| dotnet/src/webdriver/BiDi/Network/NetworkModule.HighLevel.cs | Removes the high-level interception API surface and helper types. |
| dotnet/src/webdriver/BiDi/Network/INetworkModule.cs | Removes Intercept*Async(...) members from the public network module interface. |
| dotnet/src/webdriver/BiDi/BrowsingContext/IBrowsingContextNetworkModule.cs | Removes Intercept*Async(...) members from the browsing-context scoped network interface. |
| dotnet/src/webdriver/BiDi/BrowsingContext/BrowsingContextNetworkModule.cs | Removes browsing-context high-level interception wrappers and related option records. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Remove
bidi.Network.Intercept*(...)🔗 Related Issues
Contributes to #16095
💥 What does this PR do?
This pull request refactors the network interception API in the BiDi WebDriver implementation. The main change is the removal of the high-level interception methods (
InterceptRequestAsync,InterceptResponseAsync,InterceptAuthAsync) from both theNetworkModuleandBrowsingContextNetworkModuleclasses, along with their associated option and event argument types. Instead, interception is now handled through lower-level methods likeAddInterceptAsyncand event subscriptions. Test cases have been updated accordingly to use the new API.Key changes include:
API Refactoring and Cleanup
InterceptRequestAsync,InterceptResponseAsync,InterceptAuthAsync) and their associated option types fromNetworkModule,BrowsingContextNetworkModule, and their interfaces. Interception is now performed usingAddInterceptAsyncand event handlers. [1] [2] [3] [4] [5]Test Updates
NetworkTests.csto useAddInterceptAsyncand explicit event subscriptions instead of the removed high-level interception methods. This includes updating assertions and the flow of interception handling. [1] [2] [3] [4] [5]These changes simplify the interception API, making it more explicit and flexible, while keeping the test coverage up-to-date with the new approach.
💡 Additional Considerations
Can/Will? be implemented via extensions.
🔄 Types of changes