Intercepting requests made by WebBrowser in C#

2020-02-26 09:45发布

问题:

Is it possible to intercept all requests made by a WebBrowser control?

I want to modify the request URI of every single request (including requests for images, scripts, stylesheets, etc.)

回答1:

There is an event called "BeforeNavigate2" that is called before any request is made. You can use this to modify the outgoing requests.