Home > Net >  On the inside of the FIDDLER response content of the return value to replace the rules
On the inside of the FIDDLER response content of the return value to replace the rules

Time:10-01

Below is I found the response of the return value in the baidu to replace rules, now want to add a rule, for example in the original rules have a return value of the rules of "basketball" into a "football", now want to add a change "badminton" to "table tennis" rule, to solve how to add more to replace the rules? There are many online modification request header to replace rules, but I only find a return value to replace and can not set up multiple conditions,,, o master, or have other available similar rules?




Second, replace the response is specified in the string

1, add switch before OnBeforeResponse

Public static RulesOption (" replace the return value specifies the string ")
Var m_showReplaceString: Boolean=false;

2, add the following code within the OnBeforeResponse and save the js
//replace the response is specified in the string, quotes need to escape
//oSession. HostnameIs (" www.baidu.com "), the replacement for the specified domain name www.baidu.com
//ExistsAndContains (" the content-type ", "application/json") according to the Response headers to modify the value of the content-type
If (m_showReplaceString & amp; & OSession. HostnameIs (" www.baidu.com ") & amp; & OSession. OResponse. Headers. ExistsAndContains (" the content-type ", "application/json")) {
//to decode format decoding
OSession. UtilDecodeResponse ();
//replace former string
Var oReplaceStrings=new Array (" basketball ");
//replacement string (corresponding)
Var oNewStings=new Array (" soccer ");

Var iEach=0;

OSession [" UI - customcolumn "]=String. The Empty;

For (iEach; IEach//if true
If (oSession. UtilReplaceInResponse (oReplaceStrings [iEach], oNewStings [iEach])) {
//color tag
OSession [" UI - color "]="# B03060";
//bold
OSession [" UI - bold "]="true";
//is replaced in the custom to identify the response string
OSession [" UI - customcolumn "] +=oReplaceStrings [iEach] + "; ";
}

}
}
  • Related