Skip to content

Instantly share code, notes, and snippets.

@gersilex
Last active July 5, 2021 17:22
Show Gist options
  • Save gersilex/ea7fd6bc3793d9c966dd46484718c814 to your computer and use it in GitHub Desktop.
Save gersilex/ea7fd6bc3793d9c966dd46484718c814 to your computer and use it in GitHub Desktop.
Filter for body content in Fiddler using Fiddlerscript
  1. Open the Fiddlerscript tab in Fiddler
  2. Fiddlerscript is already pre-filled and contains all the logic you selected. Don't erase the script that is in there. Instead, use the 'Go to' dropdown and go to the 'onBeforeResponse' function.
  3. Replace the content with the following and edit to your liking:
static function OnBeforeResponse(oSession: Session) {
  oSession.utilDecodeResponse();
  var body = oSession.GetResponseBodyAsString();
  if (!body.Contains("Dog concerto")) {
      oSession["ui-hide"] = "true";
  }
}

The code above will hide every response from the UI that does not contain the string "Dog concerto".

JScript.NET Reference http://fiddler2.com/r/?msdnjsnet

FiddlerScript Reference http://fiddler2.com/r/?fiddlerscriptcookbook

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