Hi,
We are trying to use FiddlerCore in our WPF app with an embedded browser (System.Windows.Controls.WebBrowser). The app displays external website content. When user tries to navigate to a specific URL, we want to detect this and redirect to another one. We are using the
BeforeRequest event for this logic.
private static void BeforeRequestProcessing(Fiddler.Session oS)
{
string path = oS.url;
if (path.Contains("External?"))
{
oS.url = "http://en.wikipedia.org/wiki/Main_Page";
}
}
It works fine in normal page navigation in the website. There is one place where, on click of a button on the website, it fires a JavaScript method. Inside the method, it calls a URL with a callback, which we are interested in detecting. Afterwards, the JS method opens a modal dialog. (There’s no navigation happening on screen – only a call to URL and a modal window pops up)
In the above case, we are able to detect the URL call from within the JS method. But the redirect is not working. We could detect the new URL we gave in subsequent BeforeRequestProcessing event firings, but actual redirect to new URL is not happening.
Can’t we redirect, when call is detected inside JavaScript method?