Skip to content

Instantly share code, notes, and snippets.

@ericlaw1979
Created November 17, 2015 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericlaw1979/9b08786e3fea4310a023 to your computer and use it in GitHub Desktop.
Save ericlaw1979/9b08786e3fea4310a023 to your computer and use it in GitHub Desktop.
When loading a SAZ file, hides Sessions based on response content type
// Click Rules > Customize Rules. Scroll to the OnBoot function.
//Inside that function, add:
FiddlerApplication.add_OnLoadSAZ(onLoadSAZ);
// Just outside that OnBoot function, add the following code:
static function onLoadSAZ(sender: Object, oEA: FiddlerApplication.ReadSAZEventArgs)
{
if (oEA.arrSessions.Length < 1) return;
var arrSess: Session[] = oEA.arrSessions;
// Update this list with Content-Type prefixes you'd like to hide.
var sIgnoreTypes: String[] = ["image/", "text/css", "application/javascript",
"application/x-shockwave-flash", "text/javascript"];
FiddlerApplication.UI.lvSessions.BeginUpdate();
for(var i:int=0; i<arrSess.Length; i++)
{
if (arrSess[i].ViewItem == null) continue;
if (arrSess[i].oResponse == null) continue;
var sContentType = arrSess[i].oResponse.MIMEType;
if (StringExtensions.OICStartsWithAny(sContentType, sIgnoreTypes))
{
FiddlerApplication.Log.LogString("Script Filtered loaded Session with response of type: " + sContentType);
arrSess[i]["ui-hide"] = "true";
arrSess[i].RefreshUI();
}
FiddlerApplication.UI.lvSessions.EndUpdate();
}
}
// Save the file and restart Fiddler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment