在主界面菜单上
Rules->CustomRules
在class Handlers{}里添加class
如:
显示响应时间
class Handlers { …… public static BindUIColumn("Time/ms" ,120) function TimeTaken(oS: Session): String{ var sResult = "0"; //获得时间戳的ms值 var t1_ms = oS.Timers.ClientBeginResponse.ToUniversalTime().Millisecond; //获得时间戳的minute值 var t1_m = oS.Timers.ClientBeginResponse.ToUniversalTime().Minute; //获得时间戳的second值 var t1_s = oS.Timers.ClientBeginResponse.ToUniversalTime().Second; var t1 = t1_m*60*1000 + t1_s*1000 + t1_ms ; var t2_ms = oS.Timers.ClientDoneRequest.ToUniversalTime().Millisecond; var t2_m = oS.Timers.ClientDoneRequest.ToUniversalTime().Minute; var t2_s = oS.Timers.ClientDoneRequest.ToUniversalTime().Second; var t2 = t2_m*60*1000 + t2_s*1000 + t2_ms ; if(t1 >= t2){ var t3 = t1 - t2; sResult = t3.toString(); } return sResult; } …… }
如图:
显示服务器IP
搜索 static function Main() 在{}内添加下面这行
FiddlerObject.UI.lvSessions.AddBoundColumn("ServerIP", 120, "X-HostIP");
static function Main() { var today: Date = new Date(); FiddlerObject.UI.lvSessions.AddBoundColumn("IP", 120, "X-HostIP"); FiddlerObject.StatusText = " CustomRules.js was loaded at: " + today; // Uncomment to add a "Server" column containing the response "Server" header, if present // UI.lvSessions.AddBoundColumn("Server", 50, "@response.server"); // Uncomment to add a global hotkey (Win+G) that invokes the ExecAction method below... // UI.RegisterCustomHotkey(HotkeyModifiers.Windows, Keys.G, "screenshot"); }