Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fiddler: blocking (filtering out) a specific page

Tags:

fiddler

I want to filter out a specific page from showing up in the sessions list. I'm not talking about filtering out entire domains/ hosts (using the filters tab) nor am I talking about actually blocking the page from loading (which can be done with an extension) - I just don't want to SEE this page in the sessions list. 10x.

like image 558
user1263416 Avatar asked Mar 12 '12 06:03

user1263416


2 Answers

Rules > Customize Rules. Scroll to OnBeforeRequest. Add the following block:

if (oSession.fullUrl == "http://whatever/whatever"){
  oSession["ui-hide"] = "do not want to see";
}
like image 160
EricLaw Avatar answered Jan 04 '23 11:01

EricLaw


I use this at the beginning of my OnBeforeRequest function. It's a little more sophisticated - not only does it filter out the rows for the specified page, it also filters out rows for any requests generated by the filtered page.

function RequestContains (uri:String) {
    return oSession.uriContains(uri) || oSession.oRequest.headers.ExistsAndContains("Referer", uri);
}
if (
    false
    ||  RequestContains("url1.aspx")
    ||  RequestContains("url2.aspx")
    ||  RequestContains("url3.aspx")
    ||  RequestContains("url4.aspx")
    ||  RequestContains("url5.aspx")
    ||  RequestContains("service1.svc")
    )
    oSession["ui-hide"] = "true";

I put the false at the beginning of the if-block so that I can easily and safely comment out any of the RequestContains lines if I temporarily need to see those requests.

I'd love to somehow get this pattern into a UI extension to the Filters tab, where I could manage a list of these URLs without having to edit the FiddlerScript. Anyone know how to do that from within the FiddlerScript code itself?

like image 42
korisu Avatar answered Jan 04 '23 10:01

korisu