Created
November 17, 2015 21:27
-
-
Save ericlaw1979/9b08786e3fea4310a023 to your computer and use it in GitHub Desktop.
When loading a SAZ file, hides Sessions based on response content type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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