Lets say this function...
function foo(param){
// original works
}
is already in-place in an html document.
I have a bookmarklet that injects an external script to the document. From that script, I want to modify the behavior of foo() function into this...
function foo(param){
// original works
bar(param);
}
bar() is a new function in the injected script. I have no problem duplicating foo in the injected script.
How do I do this?