Building a Custom Fiddler Inspector Plugin for Request Inspection
Fiddler is a powerful web debugging proxy that supports extensibility through .NET-based plugins. This article walks through building a custom inspector plugin—designed to display raw HTTP request bodies in a dedicated tab—using the Inspector2 and IRequestInspector2 interfaces. Unlike global extensions, inspector plugins apear under the Inspectors tab alongside built-in views like TextView or Headers, making them ideal for per-session analysis.
Plugin Architecture Overview
Fiddler organizes extensions into distinct categories based on scope and lifecycle:
- Global Extensions: Implement
IFiddlerExtension,IAutoTamper, etc. Loaded once at startup; appear in main toolbars or menus. - Inspector Plugins: Implement
Inspector2+IRequestInspector2(orIResponseInspector2). Bound to individual sessions; rendered inside the Inspectors pane. - Commmand Handlers: Use
IHandleExecActionto respond to FiddlerScript commands. - Import/Export Modules: Implement
ISessionImporter/ISessionExporterfor bulk session handling.
Development Setup
This example targets Fiddler v5.0.20173.49666, which requires .NET Framework 4.6.1. Lower framework versions trigger compatibility warnings during load.
- Create a new Class Library (.NET Framework) project in Visual Studio.
- Add a reference to
Fiddler.exe(typically located inC:\Program Files\Fiddler2\Fiddler.exe). - In
AssemblyInfo.cs, declare version compatibility:
[assembly: Fiddler.RequiredVersion("5.0.20173.49666")]
Implementing the Inspector
Define a Windows Forms UserControl named BodyViewerControl containing a public RichTextBox named rtbContent.
Then implement the inspector class:
using System;
using System.Windows.Forms;
using Fiddler;
namespace FiddlerInspectorPlugin
{
public class BodyInspector : Inspector2, IRequestInspector2
{
private HTTPRequestHeaders _requestHeaders;
private byte[] _requestBody;
private bool _isDirty = true;
private readonly BodyViewerControl _uiControl = new BodyViewerControl();
public HTTPRequestHeaders headers
{
get => _requestHeaders;
set => _requestHeaders = value;
}
public byte[] body
{
get => _requestBody;
set
{
_requestBody = value ?? Array.Empty<byte>();
var text = Encoding.UTF8.GetString(_requestBody);
_uiControl.rtbContent.Text = text;
}
}
public bool bDirty => _isDirty;
public bool bReadOnly => true;
public override void AddToTab(TabPage tabPage)
{
tabPage.Text = "Request Body";
_uiControl.Dock = DockStyle.Fill;
tabPage.Controls.Add(_uiControl);
}
public void Clear()
{
_uiControl.rtbContent.Clear();
}
public override int GetOrder() => 95;
}
}
The GetOrder() method controls tab ordering—lower values appear earlier. Here, 95 places it just before TextView (which defaults to 100).
Deployment
After compiling, copy the resulting .dll in to Fiddler’s Inspectors folder (e.g., C:\Program Files\Fiddler2\Inspectors\). Restart Fiddler. When selecting any captured session, a new tab labeled Request Body appears under the Inspectors section, displaying the decoded UTF-8 request payload.
This foundation can be extended—for example, by adding syntax highlighting, JSON/XML formatting, or exporting logic—to support downstream test generation workflows.