採取我創建一個擴展自定義督察
完整的例子https://github.com/chouex/FiddlerExtensionExample
你將建立一個DLL和文件複製到督察和腳本在小提琴手文件夾中。重新啓動fiddler將加載展開。
注: 我用前/後生成的腳本複製DLL和VS的項目重新啓動小提琴手。
定製檢查: 此例只是美化JSON體。
public class ResponseInspector : Inspector2, IResponseInspector2
{
TextBox myControl;
private byte[] m_entityBody;
private bool m_bDirty;
private bool m_bReadOnly;
public bool bReadOnly
{
get { return m_bReadOnly; }
set
{
m_bReadOnly = value;
// TODO: You probably also want to turn your visible control CONFIG.colorDisabledEdit (false) or WHITE (true) here depending on the value being passed in.
}
}
public void Clear()
{
m_entityBody = null;
m_bDirty = false;
myControl.Text = "";
}
public ResponseInspector()
{
// TODO: Add constructor logic here
}
public HTTPResponseHeaders headers
{
get { return null; // Return null if your control doesn't allow header editing.
}
set { }
}
public byte[] body
{
get { return m_entityBody; }
set
{
// Here's where the action is. It's time to update the visible display of the text
m_entityBody = value;
if (null != m_entityBody)
{
var text = System.Text.Encoding.UTF8.GetString(m_entityBody);
if (!String.IsNullOrEmpty(text) && text.StartsWith("{"))
{
text = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(text), Formatting.Indented);
}
myControl.Text = text;
// TODO: Use correct encoding based on content header.
}
else
{
myControl.Text = "";
}
m_bDirty = false;
// Note: Be sure to have an OnTextChanged handler for the textbox which sets m_bDirty to true!
}
}
public bool bDirty
{
get { return m_bDirty; }
}
public override int GetOrder()
{
return 0;
}
public override void AddToTab(System.Windows.Forms.TabPage o)
{
myControl = new TextBox(); // Essentially the TextView class is simply a usercontrol containing a textbox.
myControl.Height = o.Height;
myControl.Multiline = true;
myControl.ScrollBars = ScrollBars.Vertical;
o.Text = "TextViewExample";
o.Controls.Add(myControl);
o.Controls[0].Dock = DockStyle.Fill;
}
}
交通篡改(在問題沒有提及,但我認爲這是非常有用的):
在IAutoTamper2
實施AutoTamperResponseBefore()
本例只需更換任何文字從 「XT」 來在每一個請求主體
我想嘗試實施一個提琴手[自定義檢查(http://docs.telerik.com/fiddler/Extend-Fiddler/CustomInspector)「C1」。 – Robert