Skip to content

Instantly share code, notes, and snippets.

@ericlaw1979
Created January 23, 2019 16:09
Show Gist options
  • Save ericlaw1979/213532c83bd75cab4cb5b2f8ed63cadb to your computer and use it in GitHub Desktop.
Save ericlaw1979/213532c83bd75cab4cb5b2f8ed63cadb to your computer and use it in GitHub Desktop.
Hide Fiddler requests where the overall elapsed time was under 1 second.
//
// Click Rules > Customize Rules. Uncomment the *OnDone* function and update it with
// the code inside the function body below.
//
// This function executes after Fiddler finishes processing a Session, regardless
// of whether it succeeded or failed. Note that this typically runs AFTER the last
// update of the Web Sessions UI listitem, so you must manually refresh the Session's
// UI if you intend to change it.
static function OnDone(oSession: Session) {
// Hide any Session that took under 1 second.
if ((oSession.Timers.ClientDoneResponse - oSession.Timers.ClientBeginRequest).TotalMilliseconds < 1000) {
// oSession["ui-backcolor"] = "green";
oSession["ui-hide"] = "fast!";
oSession.RefreshUI();
}
}
@ericlaw1979
Copy link
Author

ericlaw1979 commented Jan 23, 2019

If you’re trying to do an “After the fact” filter instead of one that runs at processing time, you’d do it like this, just inside the Handlers class

BindUIButton("Remove <1s")
ContextAction("Remove <1s")
public static function doRemoveFastSessions(arrSess: Session[]) {
	// If not running on a selection, apply to *ALL*
	if (arrSess.Length < 2) {
		arrSess = FiddlerApplication.UI.GetAllSessions(); 
	}
	for (var i: int=0; i<arrSess.Length; i++){
		var oSession = arrSess[i];
		if ((oSession.Timers.ClientDoneResponse - oSession.Timers.ClientBeginRequest).TotalMilliseconds < 1000) {
			oSession["ui-hide"] = "fast! put the word 'stealth' here to hide literally EVERYTHING, even errors, etc";
			oSession.RefreshUI();
		}
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment