class handlers
{
static var oTimer: System.Windows.Forms.Timer = new Timer();
public static ToolsAction("Request by Timer")
function doIt()
{
oTimer = new Timer();
oTimer.add_Tick(OnTimer);
oTimer.Interval = 5000;
oTimer.Start();
}
public static ToolsAction("Stop Timer")
function stopIt()
{
oTimer.Stop();
}
public static function OnTimer(sender: Object, ea: EventArgs)
{
var s = "GET blah blah";
try{
FiddlerObject.utilIssueRequest(s);
}
catch(e){
MessageBox.Show("send failed" + e.ToString());
}
}
static function OnBeforeResponse(oSession: Session) {
if (oSession.utilFindInResponse("request start", false)>-1)
{
doIt();
}
if (oSession.utilFindInResponse("request stop", false)>-1)
{
stopIt();
}
}
}
"Tool" -> "Request by timer" and "Stop Timer" works fine.
stopit(); wokrs fine too in if statement.
But doIt(); doesn't work in if statement.
I'm not good at computer thing and English too.
I can't figure out what's wrong.
Please help and thank you in advance.