Last active
December 10, 2015 22:08
-
-
Save demoive/4500041 to your computer and use it in GitHub Desktop.
Snippet - Code Injection
Injects some new code to the end of a pre-existing function, essentially redefining it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof(MYFUNC) === "function") { | |
eval(String(MYFUNC).replace(/\}\s*$/, ";NEWCODE;}")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment