Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8247569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T22:53:27+00:00 2026-06-07T22:53:27+00:00

I have a WPF application with a WebBrowser control. I’d like to intercept and

  • 0

I have a WPF application with a WebBrowser control.

I’d like to intercept and trace the http request issued by the browser control.

I don’t want to modify the content. I only want to perform some rules when loaded urls are matching a specific pattern. Especially, I have some ajax call that are returning data that populate the web controls.

I want to capture this data to act also in the container application. Is it possible? How?

The conrtol have a LoadCompleted event, but it’s only fired for the uri specifid in the Source property, not subressourceS.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T22:53:29+00:00Added an answer on June 7, 2026 at 10:53 pm

    As answered in the duplicate, here is the solution :

    I have been able to solve such issue.

    You will need some 3rd party assemblies :

    1. FiddlerCore: will act as a http proxy, embedded in your application
    2. Awesomium.net: a WebBrowser control, that works with the chromium engine. I choose this engine, because it allows to specify a proxy server just for the application.

    The idea, as you guess, is to create an in-memory proxy server, and redirect your web browser control to this proxy.

    Then, FiddlerCore publishes some events where you can analyse the request/response, especially the body.

    As it acts a proxy, all communications, including Ajax calls, Flash calls, etc, are routed by the proxy.

    If it can help, a small code that help me to prototype this behavior:

    App.cs :

    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            BootStrap();
            base.OnStartup(e);
        }
    
        private void BootStrap()
        {
            SetupInternalProxy();
            SetupBrowser();
        }
    
        private static void SetupBrowser()
        {
            // We may be a new window in the same process.
            if (!WebCore.IsRunning)
            {
                // Setup WebCore with plugins enabled.
                WebCoreConfig config = new WebCoreConfig
                {
                    ProxyServer = "http://127.0.0.1:" + FiddlerApplication.oProxy.ListenPort.ToString(),
                    EnablePlugins = true,
                    SaveCacheAndCookies = true
                };
                WebCore.Initialize(config);
            }
            else
            {
                throw new InvalidOperationException("WebCore should be already running");
            }
        }
    
        private void SetupInternalProxy()
        {
            FiddlerApplication.AfterSessionComplete += FiddlerApplication_AfterSessionComplete;
            FiddlerApplication.Log.OnLogString += (o, s) => Debug.WriteLine(s);
    
            FiddlerCoreStartupFlags oFCSF = FiddlerCoreStartupFlags.Default;
            //this line is important as it will avoid changing the proxy for the whole system.
            oFCSF = (oFCSF & ~FiddlerCoreStartupFlags.RegisterAsSystemProxy);
    
            FiddlerApplication.Startup(
                0,
                oFCSF
                );
        }
    
        private void FiddlerApplication_AfterSessionComplete(Session oSession)
        {
            Debug.WriteLine(oSession.GetResponseBodyAsString());
        }
    }
    

    MainWindow.xaml :

    <Window
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:local="clr-namespace:WpfApplication1" 
            xmlns:Custom="http://schemas.awesomium.com/winfx" 
            x:Class="WpfApplication1.MainWindow"
            Title="MainWindow" Height="350" Width="525" Loaded="MainWindow_Loaded">
        <Grid>
    
            <Custom:WebControl Name="browser"/>
    
        </Grid>
    </Window>
    

    And finally, MainWindow.xaml.cs :

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            browser.LoadURL("http://google.fr");
        }
    }
    

    You will have to add some plumbing to this application, in order to route and analyse the requestion from the app to the business class, but that’s beyond the scope of this question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a C# WPF application with a web browser control (System.Windows.Controls.WebBrowser) called wB.
I have a WPF application in which I have an embedded web browser control.
I have a simple WPF application with a webbrowser control. When I direct the
Inside of my WPF application, I have embedded a WebBrowser control, which in turn
Consider a scenario where I have a WebBrowser Control in WPF application. A web
I have a WPF application that uses 3rd party controls (like http://navigationpane.codeplex.com ) which
I have a full screen WPF application where i host a WebBrowser. Both are
I have WPF application and a window in it. Lets have something like this
I have WPF Application. I want to give ability for user by checkbox to
I have a WPF WebBrowser object in my application in which I am trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.