I used the eval function in fiddlerscript to dynamically load code from the server when fiddler was opened.But when using the eval function to process JSON, the program throws an exception.code show as below:
//Operating normallyif(oSession.uriContains('https://xxxxxx.com')){
var responseStringOriginal = oSession.GetResponseBodyAsString();
var responseJSON = Fiddler.WebFormats.JSON.JsonDecode(responseStringOriginal);
responseJSON.JSONObject['data']['data1']['data2'] = 22;
responseJSON.JSONObject['data']['data1']['data3'] = 1;
responseJSON.JSONObject['data']['data1']['data4'][0]['type'] = 2;
responseJSON.JSONObject['data']['data1']['data5'][0]['type'] = 22;
var responseStringDestinal = Fiddler.WebFormats.JSON.JsonEncode(responseJSON.JSONObject);
oSession.utilSetResponseBody(responseStringDestinal);
}
eval("if(oSession.uriContains('https://xxxxxx.com')){var responseStringOriginal=oSession.GetResponseBodyAsString();var responseJSON=Fiddler.WebFormats.JSON.JsonDecode(responseStringOriginal);responseJSON.JSONObject['data']['data1']['data2']=22;responseJSON.JSONObject['data']['data1']['data3']=1;responseJSON.JSONObject['data']['data1']['data4'][0]['type']=2;responseJSON.JSONObject['data']['data1']['data5'][0]['type']=22;var responseStringDestinal=Fiddler.WebFormats.JSON.JsonEncode(responseJSON.JSONObject);oSession.utilSetResponseBody(responseStringDestinal)}")
(It says that Hashtable cannot cast to StackFrame)
Thanks for help.