I have a function that in a different frame that I need to override. In addition, I need to call the original function from within my override. To do so, I\'m using the followin
I figured out the solution.
Basically, you take all of the code I previously posted, and the execute it from within the context of the target frame using the eval() function. So...
myFrame.eval("SomeFunction = (function () {var originalSomeFunction = SomeFunction; return function (arg1, arg2, arg2) {alert('Inside override!'); originalSomeFunction(arg1, arg2, arg3);};})();");
Because the code is now within the target frame, it doesn't go out of scope, and we don't get the "freed" error anymore.