This is a migrated thread and some comments may be shown as answers.

FiddlerCore is blocking all redirects

2 Answers 186 Views
FiddlerCore
This is a migrated thread and some comments may be shown as answers.
Andy Spears
Top achievements
Rank 1
Andy Spears asked on 26 Dec 2015, 02:08 AM

I am using Chromium to embed an web browser in a winforms app.  I insert custom JavaScript into the pages to automatically redirect the user to a login page if a certain HTML condition exists.  All this works as expected so I then added FiddlerCore with the hopes of modifying certain HTTP requests.  The problem is as long as FiddlerCore is running, page redirects initiated via JavaScript calls are canceled (see attached image).  I have very minimal code running, so I'm guessing I'm missing a configuration setting somewhere.  Any help would be greatly appreciated.  Below is the FiddlerCore code that I'm using:

 

public void Start()
{
    if (!IsStarted)
    {
        IsStarted = true;
 
        Fiddler.FiddlerApplication.BeforeRequest += FiddlerApplication_BeforeRequest;
        Fiddler.FiddlerApplication.BeforeResponse += FiddlerApplication_BeforeResponse;
 
        // For forward-compatibility with updated FiddlerCore libraries, it is strongly recommended that you
        // start with the DEFAULT options and manually disable specific unwanted options.
        FiddlerCoreStartupFlags oFCSF = FiddlerCoreStartupFlags.Default;
 
        // NOTE: In the next line, you can pass 0 for the port (instead of 8877) to have FiddlerCore auto-select an available port
        int iPort = 8877;
        Fiddler.FiddlerApplication.Startup(iPort, oFCSF);
 
        FiddlerApplication.Log.LogFormat("Created endpoint listening on port {0}", iPort);
 
    }
}
 
public void Stop()
{
    if (IsStarted)
    {
        IsStarted = false;
        Fiddler.FiddlerApplication.Shutdown();
        Fiddler.FiddlerApplication.BeforeRequest -= FiddlerApplication_BeforeRequest;
        Fiddler.FiddlerApplication.BeforeResponse -= FiddlerApplication_BeforeResponse;
    }
}
 
void FiddlerApplication_BeforeRequest(Fiddler.Session oSession)
{
         Console.WriteLine(oSession.fullUrl);
}
 
void FiddlerApplication_BeforeResponse(Fiddler.Session oSession)
{
}

2 Answers, 1 is accepted

Sort by
0
Eric Lawrence
Telerik team
answered on 28 Dec 2015, 03:47 PM
Hi, Andy--

You should hook up the OnNotification and OnLogString handlers as shown in the demo Program.cs. After you do so, I expect you'll find that there are error messages complaining that FiddlerCore isn't able to generate certificates for HTTPS interception because the certificate generator can't be found, or similar messages indicating that you haven't yet configured the system to trust FiddlerCore's root certificate (since I don't see any code that does that below)

Regards,
Eric Lawrence
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Andy
Top achievements
Rank 1
answered on 30 Dec 2015, 08:03 PM
Thanks, that helped me get the information that I needed.
Tags
FiddlerCore
Asked by
Andy Spears
Top achievements
Rank 1
Answers by
Eric Lawrence
Telerik team
Andy
Top achievements
Rank 1
Share this question
or