I need to rewrite a JavaScript function with Fiddler. I believe this answer partially addresses the problem; however, I'm still searching for RegEx information. For example:
function traceThis(message) {
//setTimeout(function() { window.opener.childWindowMessageHandler(message);}, 100);
//if (!window.console) console = {};
//console.log(message);
}
needs to become:
function traceThis(message) {
setTimeout(function() { window.opener.childWindowMessageHandler(message);}, 100);
if (!window.console) console = {};
console.log(message);
}
I imagine it would be simpler to match and replace the individual lines within the traceThis() function; however, I think it would be most useful to learn how to select and replace any desired function from the "function" to its closing "}" regardless of statements within it.