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)
{
}