Created
October 31, 2012 20:44
-
-
Save jsantell/3989749 to your computer and use it in GitHub Desktop.
Method Spy
This file contains hidden or 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
// Where native object is something like AudioContext, localStorage, XMLHttpRequest, etc.. | |
var | |
nObject = window.someNativeObject, | |
originalMethod = nObject.method; | |
nObject.method = function () { | |
// Do other things here, like track arguments | |
originalMethod.apply( nObject, arguments ); | |
} |
cesutherland
commented
Nov 1, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment