I need to override (enrich) a Javascript function. Problem is the function is generated automatically:
var original_function = getFunction('someID'); // eval('someID');
My code will be something like this:
var f = function(arg) {
do_some_stuff();
original_function(arg);
do_another_stuff();
}
And now when other part of code calls getFunction('someID') the f('someID') will be returned.
How to override the original function, when we know it’s name or we have only a function object?
all injections are stored in function